Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


elf File not valid

Hey guys,

I created a new Custom HID project using CubeMX. Unfortunately programming my STm32F4 MCU failed because the generated elf file is not valid.

The console shows the following:

code
Open On-Chip Debugger 0.10.0-dev-00274-g2ee83e0 (2017-01-12-17:09)
Licensed under GNU GPL v2
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 ‘.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v25 API v2 M v14 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 2.874370
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
stm32f4x.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08004724 msp: 0x20030000
configuring PLL

    • Programming Started **

auto erase enabled
Error: Invalid command argument
image.base_address option value (‘HID.elf’) is not valid

    • Programming Failed **

shutdown command invoked


/code

The weired part is, that for my other (normal HID) porject, everything works fine. So i think we can rule out Debugger driver connection issues ;).
Now i’m well aware that for the custom HID to acually work, i’ll have to modify the report descriptors. I have not done this yet.

To gather more information i added an LED togle Task which turns an LED on and off.
The LED is not working after trying to program my MCU using the generated elf file.

However, eclises generates a bin file as well. If I use the STLink utilities to flash that bin file onto my MCU the LED startes blinking. So there is no issue with my program. For some reason the elf file is broken.
I have perfomed a manual eclipse update via help — -->check for updates
and installed all updates. However, this did not fix the problem. Do you have any idea how to fix my problem?


greets Julian

Hi

OpenOCD seems to do some gesswork:
“Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ‘.”

I think your debugging is not well configured.

Dieter


Hm,
thx for your replay. I checked the eclipse run configurations and there is no difference between a working project and a non working project. Or is there an other place to check the Debugging configurations?


btw this is the Log for a working project, they almost look the same to me (except the last line of course)

Open On-Chip Debugger 0.10.0-dev-00274-g2ee83e0 (2017-01-12-17:09)
Licensed under GNU GPL v2
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 ‘.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v25 API v2 M v14 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 2.867916
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
stm32f4x.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000208 msp: 0x20030000
configuring PLL

    • Programming Started **

auto erase enabled
Info : device id = 0x20016419
Info : flash size = 2048kbytes
stm32f4x.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000046 msp: 0x20030000
wrote 262144 bytes from file Debug/myhidt.elf in 7.473427s (34.255 KiB/s)

    • Programming Finished **
    • Verify Started **

stm32f4x.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20030000
stm32f4x.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20030000
verified 214292 bytes in 1.639094s (127.674 KiB/s)

    • Verified OK **
    • Resetting Target **

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
shutdown command invoked


I don’t see any difference?


Hi

Both logfiles are showing that there is no configuration ‘transport select’ for OpenOCD.
I was wondering whether a local config script (bla.cfg) at all exists in your run/debug config.

Maybe this has nothing to do with the error and can work with defaults.

I my logfiles I can find (below “Programming Started”) a line like this:
Info : STM32L4xx flash size is 256kb, base address is 0x8000000

How is the FLASH ORIGIN (base address) configured in your linker script (bla.ld) ?

What are the last lines (below Building target: ... Invoking: MCU GCC Linker) from the building console in your broken project?

Dieter

Hi

I found a related OpenOCD error in the net:
https://lists.riot-os.org/pipermail/notifications/2015-February/028991.htmlQuestion

That implies to me, that the named value, “(‘exit’)” in this case, is an argument of the “-c” option of OpenOCD.
There seems to be an optional value in the list of arguments of the “-c” command option which overrides the image base address.

I have traced the complete call to openocd on my linux box
Eclipse makes a new thread and then execs openocd there:

[pid 14427] execve("/home/db/eclipse/cpp-mars/eclipse/../../../.p2/pool/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.13.0.201701121612/tools/openocd/bin/openocd", ["/home/db/eclipse/cpp-mars/eclipse/../../../.p2/pool/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.13.0.201701121612/tools/openocd/bin/openocd", "-f", "L433CCT6-mini-sys.cfg", "-s", "/array_data01/STM32L433CCTx-mini-sys-01/L433CCTx-mini-sys", "-s", "/home/db/eclipse/cpp-mars/eclipse/../../../.p2/pool/plugins/fr.ac6.mcu.debug_1.12.0.201701121612/resources/openocd/scripts", "-c", "program Debug/L433CCTx-mini-sys.elf verify reset exit"], [/* 114 vars */] <unfinished ...>
[pid 14427] <... execve resumed> )      = 0


OpenOCD is called with the argument of the “-c” command option: “programm” as used by AC6
Syntax:
program filename verify reset exit offset

In the case above taken from the net search the word “exit” was interpreted as offset by OpenOCD and so not valid.
The wording image.base_address seems to exist in the source of OpenOCD only.

Full Docu for flash commands:
http://openocd.org/doc/html/Flash-Commands.html#programQuestion

Examples:
http://openocd.org/doc/html/Flash-Programming.htmlQuestion

In the case of .elf file the “offset” is not needed because it is in the elf header.

In your case the filename seems to be taken as offset.

You should try to configure your OpenOCD the right way.

Dieter


hey
thx for your detailes replay. I did some background reading on OpenOCD.
You were right about the offset. :-) My project name “CstuomHid Test” contained spaces. SO the “Test” was taken as offset. Removing the Spaces in my porject name solved that problem.
Thx for you big help! :-)