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


STM32L4: Debug is NOT possible when PCROP is activated

Dear ST support,

I have to allocate my code after a flash memory section holding a third party IP which is protected by the PCROP. Obviously my linkerscript does NOT allocate anything at the protected location so this should work fine.

Doing this, OpenOCD stops the debugging session because it was NOT able to erase all sectors prior to load the binary code to flash.

Does OpenOCD provides an option to ignore erase error ? Can I tell OpenOCD not to access some flash memory sectors ? Any other solution ?


Here is the OpenOCD console log:

Open On-Chip Debugger 0.10.0-dev-00278-ga53935e-dirty (2017-05-09-09:25)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
padded zone erase set to 1
adapter_nsrst_delay: 100
adapter speed: 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v25 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.897312
Info : STM32L476.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002ef0 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
Info : Device id = 0x10076415
Info : STM32L4xx flash size is 1024kb, base address is 0x8000000
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002ef0 msp: 0x20018000
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002ef0 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
Info : wait_status_busy, WRPERR : error : remote address 0x40022000
Error: erase time-out error sector 100
Error: failed erasing sectors 96 to 163
Error: flash_erase returned -4
Info : dropped ‘gdb’ connection




Many thanks for reading this and maybe have a solution,
Best regards,
Sylvain

Dear OpenSTM32 support,

I am attaching a test project which is reproducing the issue.

It includes a main function with an infinite loop.

My PCROP area in flash is from 0x8030000 to 0x8042000


see project linkerscript .ld: I allocate the man function in ROM_2 memory region.
If I locate ROM_2 region before the PCROP area, I can reach my while loop as expected.
If !i locate ROM_2 region after the PCROP area, the debug session won’t start with a WRPERR. It seems that OpenOCD always tries to erase all the block from memory start sector to last allocated sector.

Can you help me on this ?

Thanks for your help,
Best regards,
Sylvain

Hello,

I am facing an odd bug with my stm32f4Discovery board in AC6Workbench based on Eclipse. In fact, I use in my code pow function of math.h library. Build runs well, debugging too. When I try to run my stm32 board (click on reset button) to display the result of my pow function, only where I calculate pow like this “pow(3,2)” works and where I try this one “pow(p,l)” after initialing p and l with 2 (p=l=2) the board stops running.
I found in many forums that I should link the math source c file by checking “Use C math library (-lm)” in “Properties -> Go to C\C++ Build -> Settings -> Tool Settings -> Gcc Linker -> Libraries” or by adding a new library named “m”. I tried all these propositions and many others I found but none of them does work.

Someone could help please.
I thank all in advance

Here is the code:

  1. include “headers.h”
  2. include “math.h”




int main (void){
double dd=0, p=2, l=2;
SystemInit();
config_usart(115200);
test_print();
while (1){
dd = pow(3,2);
serial_printel_val((uint32_t)dd);
dd = pow(p,l);
serial_printel_val((uint32_t)dd);
blink_leds();
}
return 0;
}


Here is the displayed result value:
9


Hi Sheikhna,

you should create a new topic to address another issue than mine :-)

Thanks
Sylvain


Dear all,

I am still waiting for an answer on this topic.
I moved on a bit on my side but could not solve the issue.

I retrieved the OpenOCD source code and modified it to ignore all flash sector erase error.

Nevertheless the flash write operation then fails. If I got correctly the OpenOCD process, the write algorithm creates a binary from the input linker and pads space between memory sections. The write is done from the start of the first section to the end of the last section in flash memory.
The write is always done on a continuous memory area and logically fails when the PCROP sections are reached.

Does anyone has a solution to solve this ? How could I use OpenOcd write algorithm to write section by section ? (all my attempts failed with various errors)

Thanks for your help,
Best regards,
Sylvain