2017-01-21 04:33 AM
Hey guys,
I created 2 sets of projects with CubeMX for my STM32F429I-Disc 1 board.
I project is a Device HID project, the other one is a Device Custom HID project.
The Device HID projects works fine, the Custom HID project compiles correctly but will not flash onto my MCU.
I'm aware that for the custom HID USB routine to actually work, i'll have to adjust the USB descriptors. I have not done this yet!
However this problem looks like more severe problem to me. Is there something wrong with the cube MX code generation?
The log of the failed Custom HID looks like this
Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-16-12:22)
Licensed under GNU GPL v2For bug reports, read
https://community.st.com/external-link.jspa?url=http%3A%2F%2Fopenocd.org%2Fdoc%2Fdoxygen%2Fbugs.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/SWDadapter speed: 2000 kHzadapter_nsrst_delay: 100srst_only separate srst_nogate srst_open_drain connect_assert_srstsrst_only separate srst_nogate srst_open_drain connect_assert_srstInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : clock speed 1800 kHzInfo : STLINK v2 JTAG v25 API v2 SWIM v14 VID 0x0483 PID 0x374BInfo : using stlink api v2Info : Target voltage: 2.867916Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpointsInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzadapter speed: 1800 kHzstm32f4x.cpu: target state: haltedtarget halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000250 msp: 0x20030000configuring PLL** Programming Started **auto erase enabledError: Invalid command argumentimage.base_address option value ('Test.elf') is not valid** Programming Failed **shutdown command invokedand this is the log of the working HID Device
Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-16-12:22)
Licensed under GNU GPL v2For bug reports, read
https://community.st.com/external-link.jspa?url=http%3A%2F%2Fopenocd.org%2Fdoc%2Fdoxygen%2Fbugs.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/SWDadapter speed: 2000 kHzadapter_nsrst_delay: 100srst_only separate srst_nogate srst_open_drain connect_assert_srstsrst_only separate srst_nogate srst_open_drain connect_assert_srstInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : clock speed 1800 kHzInfo : STLINK v2 JTAG v25 API v2 SWIM v14 VID 0x0483 PID 0x374BInfo : using stlink api v2Info : Target voltage: 2.867916Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpointsInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzadapter speed: 1800 kHzstm32f4x.cpu: target state: haltedtarget halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000250 msp: 0x20030000configuring PLL** Programming Started **auto erase enabledInfo : device id = 0x20016419Info : flash size = 2048kbytesstm32f4x.cpu: target state: haltedtarget halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x20000046 msp: 0x20030000wrote 262144 bytes from file Debug/Giessomat.elf in 7.384422s (34.668 KiB/s)** Programming Finished **** Verify Started **stm32f4x.cpu: target state: haltedtarget halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000002e msp: 0x20030000stm32f4x.cpu: target state: haltedtarget halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000002e msp: 0x20030000verified 213980 bytes in 1.634094s (127.878 KiB/s)** Verified OK **** Resetting Target **Info : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzadapter speed: 1800 kHzshutdown command invokeddo you have any idea how to solve the problem?
greets Julian
Solved! Go to Solution.
2017-02-21 05:50 PM
Hi
This error happens if the file name presented to the OpenOCD binary with the '-c program ...' option contains spaces.
The excess word is interpreted as offset assumed to override the base address in the .elf header.
Dieter
2017-01-21 06:03 AM
If pulling BOOT0 High solves the problem you need to look more critically at what your code is doing with the GPIO pins used for JTAG/SWD connectivity, or going into a low power mode.
Check also behaviour with the ST-LINK Utilities
2017-01-24 01:20 PM
Do you mean by actually applying a 5V signal to the BOOT0 pin, or is it possible to do this via software as well?
I checked the behaviour with ST Link Utilities.
The wired part is, that when flashing to bin file with ST Link Utilities everything worked fine. My greed LED is blinking as well, so the program is running.
If i try the same with SW4STM32 the LED is not blinking at all.
So the problem is somewhere within the SW4STM32 settings. Do you have any idea where to start looking?
2017-01-24 01:41 PM
alright I will have to do this at my work place since I don't have a Power Supply at home
SW4STM32 (based on eclipse) creates both, an elf file and a binary file. The elf file probably contains debugging informations.
I cleaned to complete project and made a rebuild to regenerate both the elf file and bin file.
However to problem still exists.
What do you mean by connecting as SWD. I don't have an external debugger, i'm using the on circuit debugger with my discovery board
2017-01-24 02:27 PM
Pull it to 3V or VDD, you can change the mapping in software but the point was to make sure it was not related to code on the part. Not sure it is 5V tolerant.
Make sure you update the ST-LINK firmware using the utilities. Make sure you update the DLL or whatever SW4STM32 is using. Make sure it connects as SWD
2017-01-24 03:20 PM
Seem to recall in Keil I have the ability to select JTAG mode or SWD mode for the ST-LINK, it is agnostic to whether it is on a DISCO or not. It will however fail in JTAG mode.
Yes the .ELF typically contains the symbols and debug metadata, this doesn't get downloaded to the part however.
2017-02-21 05:50 PM
Hi
This error happens if the file name presented to the OpenOCD binary with the '-c program ...' option contains spaces.
The excess word is interpreted as offset assumed to override the base address in the .elf header.
Dieter
2017-02-26 01:37 AM
Hi,
thx for your replay, that did actually solve my problem. Thx for your help!