Closed juhhov closed 4 years ago
@juhhov Do you have an extra WB55 board you could send to me?
Hi
Note that STM32WB chips are dual core MCU:
FLASH is shared for both cores.
See Reference Manual: https://www.st.com/resource/en/reference_manual/dm00318631.pdf
3.3.7 Flash main memory erase sequences
Flash memory mass erase
A Flash memory mass erase by the CPU1 is ignored and a bus error is generated
@MarceloSalazar @schstm
@jeromecoutant You may have found the issue. Currently, pyocd will always use the first CPU (lowest AP) for flash programming operations. It needs to be extended to honour the Pname
attribute of the PDSC <algorithm>
element.
What I don't understand, though, is that the reported error (0x20000201) was returned by the EraseChip()
API. In other words, it doesn't appear that a bus error occurred.
Fyi, I should be receiving a WB55 board on Monday (thanks @juhhov!) and can work on a fix.
hi @flit did you receive the board? Do you need something else from us to help?
@jeromecoutant so with the current CMSIS-Pack it's also not possible to execute full flash erase succesfully with Keil MDK:
I don't think it is a question of CMSIS-Pack ?
See above comments, it is defined in the chip deference manual.
The PDSC file seems to talk about M4, not about M0 (CMSIS/Flash/STM32WB_M4.FLM - information hidden also to the bottom-left corner of the picture I attached):
<!-- ************************* Device 'STM32WB55RG' ***************************** -->
<device Dname="STM32WB55RGVx">
<memory id="IROM1" start="0x08000000" size="0x00100000" startup="1" default="1" />
<memory id="IRAM1" start="0x20000000" size="0x00040000" init="0" default="1" />
<algorithm name="CMSIS/Flash/STM32WB_M4.FLM" start="0x08000000" size="0x00100000" default="1" />
<feature type="QFP" n="68"/>
</device>
CMSIS-Packs\Keil\STM32WBxx_DFP\1.1.0\Keil.STM32WBxx_DFP.pdsc
@jeromecoutant In other words if there is no flash algorithm for M0 is there need to have one? The sources are there but compiled binaries for M0Plus are missing. But I guess the same works for both cores:
#elif defined STM32WB_M4 /* 2 * 128 kB or 1 * 256 kB*/
#define FLASH_BANK_SIZE (0x08020000U)
#elif defined STM32WB_M0Plus /* 2 * 128 kB or 1 * 256 kB*/
#define FLASH_BANK_SIZE (0x08020000U)
Are CM0 SVD files missing for WB55?
@jeromecoutant CPU2 security (ESE) is enabled by default and needs to disabled explicitly?
But why do you want to erase full flash, you will loose BLE FW!!? Note if you are not interested in BLE, you should choose another STM32 chip...
But why do you want to erase full flash, you will loose BLE FW!!?
How you're actually supposed to update the BLE firmware?
Very specific procedure! Check https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32WB/README.md
In this case there is 812KiB for application software, the rest 212KiB is reserved by the BLE firmware.
pyocd erase -s 0x08000000-0x080CB000
0001122:INFO:eraser:Erasing sector 0x08000000 (4096 bytes)
0001173:INFO:eraser:Erasing sector 0x08001000 (4096 bytes)
...
0011320:INFO:eraser:Erasing sector 0x080c9000 (4096 bytes)
0011365:INFO:eraser:Erasing sector 0x080ca000 (4096 bytes)
The STM32WB55xx devices feature a single physical address space that can be accessed by the application processor and by the RF subsystem. A part of the Flash memory and of the SRAM2a and SRAM2b memories are made secure, exclusively accessible by the CPU2, protected against execution, read and write from CPU1 and DMA. In case of shared resources the SW should implement arbitration mechanism to avoid access conflicts. This happens for peripherals Reset and Clock Controller (RCC), Power Controller (PWC), EXTI and Flash interface, and can be implemented using the built-in semaphore block (HSEM). By default the RF subsystem and CPU2 operate in secure mode. This implies that part of the Flash and of the SRAM2 memories can only be accessed by the RF subsystem and by the CPU2. In this case the Host processor (CPU1) has no access to these resources.
STM32WB55xx Datasheet, Chapter 5.
@juhhov I assume this issue can be closed.
The same fail constantly occurs.
STLink version:
Traceback: