Hi, is there any way to debug the program that we download on CH582 module?

Suppose if I download the following program. 

image.png


Can we debug it?

If you need to use debugging features you can use our WCH-LINK.You can take a look at this blog post for a detailed introduction to the use of simulation.CH573 CH582 CH579 RISC-V仿真开启及使用 - debugdabiaoge - 博客园 (cnblogs.com) For Bluetooth or networking routines, we do not recommend debugging.If you mark a breakpoint in your program, Bluetooth disconnects.


When I ty to run the application Peripheral from MounRiver studio I am getting following error

image.png


What system your computer uses, if you are using Win7 you need to install the driver. You can check the wiring of the link. Emulation is not recommended when using Bluetooth, you can debug it using print. You can use our professional version of MoundRiver Studio.


Ok, how to print on console, when Iam writing an attribute. When I write something in a charateristic, which method is used in Peripheral project to take the input and process the write operation.


Add the print function when printing and view the print result through the serial debugging tool. The following function takes the write and handles the write.

emobile_2022-12-06_11-01-24.png


Ok, three questions around this.

- You mentioned there is?simpleProfileChangeCB method for handling change in characteristic value. I could see there is a method in gattProfile.c file as below snapshot, what is this used for?

image.png

- the print line that line that you have highlighted, where is it exactly printed, as I use mounriverStudio to just build the hex file and download it in the module, after download when I am changing the characteristic value from my app where can I see that print message?

- can you provide me the code snippet with which I can directly get the value of a characteristic in c program?



Where can I get serial debugging tool?


The first question you mentioned about gattProfile.c is about the configuration of the slave server. The second question printed content can be viewed through the serial debugging tool, you burn the program to the development board through the app and Bluetooth connection, according to the enumerated services to find the write service and then write data you will see in the serial debugging according to the highlighted part. There is no need to change the part of your screenshot. Please leave an email and I will send you the relevant code.

emobile_2022-12-06_15-04-38.png


I can't find serial debugging tool, can you provide me the link to download it?


Windows serial debugging software, integrated serial port function and a variety of common tools, support multiple serial port communication, serial port interworking test, file sending and receiving, string and hexadecimal data input and display, module frame format debugging. COMTransmit.ZIP - 南京沁恒微电子股份有限公司 (wch.cn)


the scope for this is only for the following :CH340, CH341, CH342, CH343, CH344, CH347, CH348, CH9101, CH9102, CH9103, CH9104, CH9143, CH9340, CH9344, CH351, CH352, CH353, CH355, CH356, CH357, CH358, CH359, CH382, CH38


Can I use it for CH583? And is there any documentation how to use this tool?


You need to have the appropriate USB-to-Serial when using it.Then connect the computer to the ch583 through this tool. Open the software to select serial port number and then select open string hgq port can be used.


只有登录才能回复,可以选择微信账号登录