Sysprogs forums › Forums › VisualGDB › Importing CubeIDE project with low level drivers
- This topic has 2 replies, 2 voices, and was last updated 1 year, 5 months ago by GeneM.
-
AuthorPosts
-
June 12, 2023 at 20:32 #34352GeneMParticipant
I’m trying to import a simple project that I started with STMCubeIDE with a couple of timers, a couple of UARTs and the FatFs file system. CubeMX is built into CubeIDE and I used that to generate the basic project setup code. I’m trying to use the STM low level (LL) drivers as much as possible so the timers and UARTs use LL drivers but FatFs and the associated SDMMC interface have to use HAL drivers in CubeMX. I can import the project and build it in VGDB fine. I can single step through the HAL_Init() and the SystemClock_Config() function (which uses LL drivers) fine. But when it enters the MX_GPIO_Init() function, I get the error below.
I found the IMPORTING STM32CUBEMX LL PROJECT thread from 2017 but since my project runs the SystemClock_Config() function which uses LL drivers I’m not sure that thread applies.
I tried creating a zip file of the project that might help but I couldn’t include all the files or it wouldn’t fit in the 512 kB limit.
C:\Users\gene\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.arm.openocd\bin\openocd.exe -c "gdb_port 53172" -c "telnet_port 53170" -f interface/stlink.cfg -f target/stm32h7x_dual_bank.cfg -c init -c "reset init" -c "echo VisualGDB_OpenOCD_Ready" Open On-Chip Debugger 0.12.0 (2023-02-02) [https://github.com/sysprogs/openocd] Licensed under GNU GPL v2 libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : clock speed 1800 kHz Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED Info : STLINK V3J5M2 (API v3) VID:PID 0483:374E Info : Target voltage: 3.283622 Info : [stm32h7x.cpu0] Cortex-M7 r1p1 processor detected Info : [stm32h7x.cpu0] target has 8 breakpoints, 4 watchpoints Info : starting gdb server for stm32h7x.cpu0 on 53172 Info : Listening on port 53172 for gdb connections [stm32h7x.cpu0] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x080007a8 msp: 0x20020000 Info : Unable to match requested speed 4000 kHz, using 3300 kHz Info : Unable to match requested speed 4000 kHz, using 3300 kHz VisualGDB_OpenOCD_Ready Info : Listening on port 6666 for tcl connections Info : Listening on port 53170 for telnet connections Info : accepting 'gdb' connection on tcp/53172 Info : Device: STM32H7Ax/7Bx Info : flash size probed value 2048k Info : STM32H7 flash has dual banks Info : Bank (0) size is 1024 kb, base address is 0x08000000 Info : Device: STM32H7Ax/7Bx Info : flash size probed value 2048k Info : STM32H7 flash has dual banks Info : Bank (1) size is 1024 kb, base address is 0x08100000 Warn : Prefer GDB command "target extended-remote :53172" instead of "target remote :53172" [stm32h7x.cpu0] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x080007a8 msp: 0x20020000 Info : Unable to match requested speed 4000 kHz, using 3300 kHz Info : Unable to match requested speed 4000 kHz, using 3300 kHz Info : Device: STM32H7Ax/7Bx Info : flash size probed value 2048k Info : STM32H7 flash has dual banks Info : Bank (0) size is 1024 kb, base address is 0x08000000 Info : Device: STM32H7Ax/7Bx Info : flash size probed value 2048k Info : STM32H7 flash has dual banks Info : Bank (1) size is 1024 kb, base address is 0x08100000 [stm32h7x.cpu0] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x080007a8 msp: 0x20020000 Info : Unable to match requested speed 4000 kHz, using 3300 kHz Info : Unable to match requested speed 4000 kHz, using 3300 kHz Info : Erasing FLASH: 0x08000000-0x08008000... Info : Programming FLASH (1 sections, 32664 bytes)... Info : Programming FLASH section 1/1 (32664 bytes) at 0x08000000... Info : Padding image section 0 at 0x08007f98 with 8 bytes (bank write end alignment) [stm32h7x.cpu0] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08007e24 msp: 0x24100000 Info : halted: PC: 0x08002728 Info : halted: PC: 0x08001744 Info : halted: PC: 0x08001d80 Error: jtag status contains invalid mode value - communication failure Warn : target stm32h7x.cpu0 is not halted (gdb fileio) Polling target stm32h7x.cpu0 failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 100ms Info : Previous state query failed, trying to reconnect Error: jtag status contains invalid mode value - communication failure Polling target stm32h7x.cpu0 failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 300ms Info : Previous state query failed, trying to reconnect Error: jtag status contains invalid mode value - communication failure Polling target stm32h7x.cpu0 failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 700ms Info : Previous state query failed, trying to reconnect Error: jtag status contains invalid mode value - communication failure Polling target stm32h7x.cpu0 failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 1500ms Info : Previous state query failed, trying to reconnect Error: jtag status contains invalid mode value - communication failure Polling target stm32h7x.cpu0 failed, trying to reexamine
- This topic was modified 1 year, 5 months ago by GeneM.
- This topic was modified 1 year, 5 months ago by support. Reason: formatting
Attachments:
You must be logged in to view attached files.June 12, 2023 at 20:57 #34356supportKeymasterHi,
Please make sure you can build and debug the same project for the same device on the same development computer outside VisualGDB (e.g. by building it via command line and running OpenOCD manually). If it doesn’t work, importing it into VisualGDB will not fix it either.
If it does work outside VisualGDB, please let us know and we will help you configure VisualGDB to replicate the manual build results.
June 13, 2023 at 18:33 #34363GeneMParticipantI sure wish I’d thought of that before I posted my question. My project built but didn’t run in CubeIDE either. I had mistakenly clicked the “Set all pins as analog (to optimize the power consumption)” option. Clearly, some pin was being configured under the hood as analog that should not have been. I’ve been able to import my simple CubeIDE with low level drivers project into VGDB as a MSBuild project and as an Advances CMake project and blink an LED.
The short term goal is to make sure I can read a UART with DMA, write to a uSD card with FatFS and add unit tests. The long term goal is to see if I can mock hardware and run unit tests on my Windows development box as described in the VGDB tutorials.
Thanks for the help
-
AuthorPosts
- You must be logged in to reply to this topic.