Expressions in Modus Toolbox 3.0

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ravo
Level 5
Level 5
10 likes received 5 comments on blog 5 solutions authored

Dears, I would like to debug one application in Modus Toolbox. In 2.4 all works fine.

But now I got some strange behaviour in Modus Toolbox GUI. When I add watch expression, it will add blank line...

ravo_1-1670316313059.png

I see variable name only when I click on this "empty line" as shown on next image. And of course I am not able to view any expressions values or results.

ravo_0-1670316307001.png

What could be wrong ? I tried to restart Modus Toolbox and/or complete PC, and it did not helped me.

Regards

Radim

0 Likes
1 Solution
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @ravo ,

I was unable to recreate this issue but a possibly similar issue was found please look through the link.
https://stackoverflow.com/questions/10671812/watch-expression-doesnt-show-value-in-eclipse-with-java

Warm Regards,
Gautami J

 

View solution in original post

22 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

Are you clicking on the line directly for adding a watch expression? Does the same behavior persist when you click the "+" symbol as shown?

LeoMathews_0-1670325681316.png

Thanks and Regards,
Leo

 

0 Likes

Dear @LeoMathews ,

It does not matter if I click on + Add new expression or right-mouse click on variable in editor end execute command "Add watch expression..."

ravo_0-1670327176976.png

it is quite similar as old bug in Eclipse - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=551404

Radim

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

I could not observe this strange behavior form my part. Can you please try re-installing ModusToolbox 3.0 from this page?

Thanks and Regards,
Leo

0 Likes

Dear @LeoMathews ,

it is new installation. I found the it happened when I try to debug demo project "USB Audio Device (FreeRTOS)https://github.com/Infineon/mtb-example-psoc6-usb-audio-device-freertos. So It seems that it happens when try to debug project with USB communication. I would like verify buffer content received from USB.

I set breakpoint in file audio_out.c in audio_out_endpoint_callback function on line

data_to_write = count / AUDIO_SAMPLE_DATA_SIZE;

On Github It is 208 line https://github.com/Infineon/mtb-example-psoc6-usb-audio-device-freertos/blob/master/source/audio_out...

I used my HW based on cy8ckit-062-wifi-bt

Regards

Radim

 

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

Are you seeing the same issue while trying to use another application? Can you please try debugging another application involving USB communication and see if the same issue is observed in the expressions tab?

Thanks and Regards,
Leo

0 Likes

Dear @LeoMathews 

I tested another application emUSB Device: HID generic application https://github.com/Infineon/mtb-example-usb-device-hid-generic/blob/master/README.md and it seems that there it works normally.

So it could be only in USB Audio Device (FreeRTOS)  project. Do you have another advice ?

Radim

 

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

Looks like this anomaly is present only for this example "USB Audio Device (FreeRTOS)". I will check with the internal software team and will update you as soon as I get a reply from them.

Thanks and Regards,
Leo

0 Likes

Dear @LeoMathews ,

thanks for response. I will wait if you find something... It is terrible for me that I am unable to debug, see memory content.

Radim

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

The internal team couldn't recreate the issue. The debug session of the example project was working perfectly from their side. Can you please make sure that the example project runs without any errors?

Can you please make sure whether the CY8CKIT-028-TFT shield or the Pmod I2S2 is properly connected to the board? Can you also try debugging by removing the breakpoint and see whether it works then?

Thanks and Regards,
Leo

0 Likes

Dear @LeoMathews, I will prepare and send example project...

I am running on CY8CKIT-062-WIFI-BT and also on cy8cproto-062s3-4343w and my derived HW which is combination of CY8C6247BZI-D54 and I2S2 module (to be working I modified the MAKEFILE and disable #COMPONENTS+=AK4954A for my config. I will also try in older version Modus Toolbox 2.4 if the issue exists here.

It will take some time to prepare...

Thanks in advance

Radim

0 Likes
lock attach
Attachments are accessible only for community members.
ravo
Level 5
Level 5
10 likes received 5 comments on blog 5 solutions authored

I am attaching the sample project project for CY8CKIT-062-WIFI-BT. I setup one breakpoint in audio_out.c, as shown on picture:

ravo_2-1673303312188.png

 

I would like to see received buffer content from USB. I suppose that it will hang the USB Audio communication, but I hope that actual buffer content could be displayed in Expression window if it is written here.

But Expressions table is showing only blank lines... Active "selected" Expression is showed only when I click on desired line, but without any value.

ravo_0-1673302994743.png

Updated on Jan 11: USB_Audio_CY8CKIT_062_Original.zip i correct sample code instead of 2022-11-30 SPEAKERBOX libspeex 146MHz.zip (which I removed now)

What could be wrong in the code or ModusToolbox IDE?

Regards

Radim

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

I couldn't replicate the issue from my part i.e the blank lines are not appearing. Looks like there are no issues with the code part. Did you place any other breakpoints in the source code? If so are they behaving in the same manner? Also can you please share whether you are using the Audacity tool? Does the tool hang while debugging? As you mentioned the cause may be the USB audio communication getting hanged. 

Thanks and Regards,
Leo

0 Likes

Dear @LeoMathews ,

thanks for response. I did not put any another breakpoint - only one on convert_24_to_32_array(). Yes ofcourse I use Audacity. I know if I pause running code - the Audacity will hang up or freeze. But it is not problem for me. The main problem is that I am unable to view variables after that breakpoint.

Radim

0 Likes
ravo
Level 5
Level 5
10 likes received 5 comments on blog 5 solutions authored

Dear @LeoMathews ,

If you are unable to replicate this issue, could you send me project which you test ?

I am still unable to debug this USB application, I really need to see received buffer content from USB and see how data is later processed by my code (even if USB transfers hangs after breakpoint)

Here is log  from Modus Toolbox when reaching the breakpoint.

psoc6.cpu.cm4 halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x1001050c psp: 0x08004558, semihosting
Info : psoc6.cpu.cm4: Waiting up to 10.0 sec for valid Vector Table address...
Info : psoc6.cpu.cm4: Vector Table found at 0x10002000
Info : psoc6.cpu.cm4: bkpt @0x100022D1, issuing SYSRESETREQ
Info : SWD DPIDR 0x6ba02477
psoc6.cpu.cm4 halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x100022d0 msp: 0x08047800, semihosting
Info : [psoc6.cpu.cm0] external reset detected
===== arm v7m registers
(0) r0 (/32): 0x40210400
(1) r1 (/32): 0x0000000e
(2) r2 (/32): 0x402102c0
(3) r3 (/32): 0x10002000
(4) r4 (/32): 0x100022d1
(5) r5 (/32): 0x00000000
(6) r6 (/32): 0x00000000
(7) r7 (/32): 0xa5a5a5a5
(8) r8 (/32): 0xa5a5a5a5
(9) r9 (/32): 0xa5a5a5a5
(10) r10 (/32): 0xa5a5a5a5
(11) r11 (/32): 0xa5a5a5a5
(12) r12 (/32): 0x00000006
(13) sp (/32): 0x08047800
(14) lr (/32): 0xffffffff
(15) pc (/32): 0x100022d0
(16) xPSR (/32): 0x61000000
(17) msp (/32): 0x08047800
(18) psp (/32): 0x08004558
(20) primask (/1): 0x00
(21) basepri (/8): 0x00
(22) faultmask (/1): 0x00
(23) control (/3): 0x00
(42) d0 (/64): 0x3feffffffffffff7
(43) d1 (/64): 0x3b09d747f23e3400
(44) d2 (/64): 0x7fd3ff5fdfe9ffd6
(45) d3 (/64): 0xffefbfd7ffebb7f7
(46) d4 (/64): 0x6be5ff57ddcfdfd7
(47) d5 (/64): 0x7fadbf7f5defdf57
(48) d6 (/64): 0x3dfd9ffb4dafb7f7
(49) d7 (/64): 0x3fc90fdb00000000
(50) d8 (/64): 0x6e7fb7fffdefbf97
(51) d9 (/64): 0xdffbb7ddf5fff3f5
(52) d10 (/64): 0xdde9d6f7cddfb7dd
(53) d11 (/64): 0x7fbfb7df7de9f77f
(54) d12 (/64): 0xdbfef5d7dfa7b7df
(55) d13 (/64): 0xdffffffffffdf7ff
(56) d14 (/64): 0xbddedef7fdf9fdf7
(57) d15 (/64): 0xf9fbbfdf4dfb5fff
(58) fpscr (/32): 0x00000000
===== Cortex-M DWT registers
Info : The target is not running when halt was requested, stopping GDB.

But icons in Modus Toolbox did not correspond - it looks that code is still running:

ravo_1-1674767922578.png

 

Thanks in advance for any help or ideas how to debug this application

Radim

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

I have only tested with the code example available in MTB "USB Audio Device (FreeRTOS)". But I believe the issue mainly occurs when audacity fails to recognize the USB device while debugging. Can you make sure audacity still recognizes the device while debugging?

The device should be recognized as "PSoC 6 USB Audio Device".

Thanks and Regards
Leo

0 Likes

Dear @LeoMathews,

I had another idea, how to minimize USB interference between two device at one time (USB audio & MiniProg4) So I tried also use two computers - one for debug with PSoC MiniProg4 and second one connected via USB audio device. And it is same as previous setup (debug and Audacity on same PC). So there should be another problem...

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

I apologize for the delayed response. I tried debugging the same code example again, and the expression tab shows this behavior while restarting the debug session. The added expression can only be viewed after clicking the empty line. 

I believe there might be some synchronization issues of the clocks between the USB host and the PSoC 6 MCU audio subsystem in the OUT endpoint flow. I am looking into this issue and analyzing the synchronization issues of the clocks. I can't yet pinpoint the exact cause of the problem.

Thanks and Regards,
Leo

0 Likes

Dear @LeoMathews ,

can you send me your project ? Than I can test here on my computer if it will works...

I put breakpoint on line in audio_out.c, in function audio_out_endpoint_callback

data_to_write = count / AUDIO_SAMPLE_DATA_SIZE;

Than I run program... and start playing some sound in Windows.

Than the program hangs. (usb of course freezes it is ok, no problem for me) but after long wait it will put in console "Info : dropped 'gdb' connection", see log from debug session:

Started by GNU MCU Eclipse
Open On-Chip Debugger 0.11.0+dev-4.4.0.2134 (2022-09-08-13:07)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
kitprog3 set_latest_version: C:/Users/xxx/ModusToolbox/tools_3.0/fw-loader 2.40.1241
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
adapter speed: 2000 kHz
adapter srst delay: 25
adapter srst pulse_width: 25
** Auto-acquire enabled, use "set ENABLE_ACQUIRE 0" to disable
cortex_m reset_config sysresetreq
cortex_m reset_config sysresetreq
Warn : SFlash programming allowed for regions: USER, TOC, KEY
Info : Using CMSIS-DAPv2 interface with VID:PID=0x04b4:0xf151, serial=140E16C401287400
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : KitProg3: FW version: 2.40.1241
Info : KitProg3: Pipelined transfers enabled
Info : KitProg3: Asynchronous USB transfers enabled
Info : VTarget = 3.293 V
Info : kitprog3: acquiring the device (mode: reset)...
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x6ba02477
Info : [psoc6.cpu.cm0] Cortex-M0+ r0p1 processor detected
Info : [psoc6.cpu.cm0] target has 4 breakpoints, 2 watchpoints
Info : [psoc6.cpu.cm0] external reset detected
***************************************
** Silicon: 0xE206, Family: 0x100, Rev.: 0x23 (B2)
** Detected Device: CY8C6247BZI-D54
** Detected Main Flash size, kb: 1024
** Flash Boot version: 1.20.1.42
** Chip Protection: NORMAL
***************************************
Info : [psoc6.cpu.cm4] Cortex-M4 r0p1 processor detected
Info : [psoc6.cpu.cm4] target has 6 breakpoints, 4 watchpoints
Info : [psoc6.cpu.cm4] external reset detected
Info : starting gdb server for psoc6.cpu.cm0 on 3332
Info : Listening on port 3332 for gdb connections
Info : starting gdb server for psoc6.cpu.cm4 on 3333
Info : Listening on port 3333 for gdb connections
Info : SWD DPIDR 0x6ba02477
Info : kitprog3: acquiring the device (mode: reset)...
psoc6.cpu.cm0 halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00001f34 msp: 0x080477a8
** Device acquired successfully
** psoc6.cpu.cm4: Ran after reset and before halt...
psoc6.cpu.cm4 halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x1600400c msp: 00000000
Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Info : New GDB Connection: 1, Target psoc6.cpu.cm4, state: halted
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
semihosting is enabled
Info : Auto-detected RTOS: FreeRTOS
Info : Auto-detected RTOS: FreeRTOS
Verifying region (0x10000000, 6420)... Match
Verifying region (0x10002000, 110472)... Match
Info : All data matches, Flash programming skipped
Info : SWD DPIDR 0x6ba02477
psoc6.cpu.cm4 halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x100104ec psp: 0x08003d78, semihosting
Info : psoc6.cpu.cm4: Waiting up to 10.0 sec for valid Vector Table address...
Info : psoc6.cpu.cm4: Vector Table found at 0x10002000
Info : psoc6.cpu.cm4: bkpt @0x100022D1, issuing SYSRESETREQ
Info : SWD DPIDR 0x6ba02477
psoc6.cpu.cm4 halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x100022d0 msp: 0x08047800, semihosting
Info : [psoc6.cpu.cm0] external reset detected
===== arm v7m registers
(0) r0 (/32): 0x40210400
(1) r1 (/32): 0x0000000e
(2) r2 (/32): 0x402102c0
(3) r3 (/32): 0x10002000
(4) r4 (/32): 0x100022d1
(5) r5 (/32): 0x00000000
(6) r6 (/32): 0x00000000
(7) r7 (/32): 0xa5a5a5a5
(8) r8 (/32): 0xa5a5a5a5
(9) r9 (/32): 0xa5a5a5a5
(10) r10 (/32): 0xa5a5a5a5
(11) r11 (/32): 0xa5a5a5a5
(12) r12 (/32): 0x00000006
(13) sp (/32): 0x08047800
(14) lr (/32): 0xffffffff
(15) pc (/32): 0x100022d0
(16) xPSR (/32): 0x61000000
(17) msp (/32): 0x08047800
(18) psp (/32): 0x08003d78
(20) primask (/1): 0x00
(21) basepri (/8): 0x00
(22) faultmask (/1): 0x00
(23) control (/3): 0x00
(42) d0 (/64): 0x3fed906bcfcf59d7
(43) d1 (/64): 0xbc5a626331000000
(44) d2 (/64): 0x6faef53affafd3b8
(45) d3 (/64): 0x7fe40db07fc73dad
(46) d4 (/64): 0x7fb075d37facce3c
(47) d5 (/64): 0x7fbcb9beffabe5ae
(48) d6 (/64): 0x3a03126f42000000
(49) d7 (/64): 0x41000000467a0000
(50) d8 (/64): 0xff83f5fc7fb4011c
(51) d9 (/64): 0x7faa613e6fbfb4b0
(52) d10 (/64): 0xff9b76e5ffab66b9
(53) d11 (/64): 0x7ff5d3947ffb4f2d
(54) d12 (/64): 0xffcfb760ffaf06f9
(55) d13 (/64): 0x7fbdb24b7fbe21ee
(56) d14 (/64): 0x7f8cdf8c7fae5018
(57) d15 (/64): 0x7f8a7159ff8355b6
(58) fpscr (/32): 0x00000000
===== Cortex-M DWT registers
Info : dropped 'gdb' connection

So it look like that debugger is disconnected...

 

I find some strange behaviour - "it look like that I am unable to remove breakpoint" if I double click on blue dot, then breakpoint is removed from list but blue dot till remain visible. See picture bellow:

ravo_0-1676508017001.png

It is really strange, I urgently need debugging USB project to see some variable values, it is very time consuming to  do it other way (using scope ...)

Do you have idea how to get debug working ?

Best Regards

Radim

0 Likes
lock attach
Attachments are accessible only for community members.
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @ravo 

I have attached the project I used. Please check whether you are able to debug the same.

Thanks and Regards,
Leo

Dear @LeoMathews ,

thanks for project. I just tested it in Modus Toolbox 3.0 I can reach breakpoint, but I am still unable to view expression, I triad manually add new expression in Expression Window or by right mouse click on selected line in code view and "Add Watch expressions..." but still empty window with blinking artefacts... the Expression name is hidden until I click on line, but value is never shown.

ravo_0-1676983435032.png

I don't know what is wrong... I also try to connect USB audio device to another PC to minimise USB collision between audio and programmer...

Any help is greatly appreciated. 

Best regards

 

0 Likes
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @ravo ,

I was unable to recreate this issue but a possibly similar issue was found please look through the link.
https://stackoverflow.com/questions/10671812/watch-expression-doesnt-show-value-in-eclipse-with-java

Warm Regards,
Gautami J

 

Dear @Gautami_12 thanks for this tip! I will check it and write soon back.

Regards

Radim

0 Likes