renesas / fsp

Flexible Software Package (FSP) for Renesas RA MCU Family
https://renesas.github.io/fsp/
Other
192 stars 82 forks source link

RA8M1 / RA8D1 : J-Link OSPI Flash Loader fails if flash in OSPI mode #330

Open renesas-andyb opened 11 months ago

renesas-andyb commented 11 months ago

J-Link provides a flash loader for the RA8x1 MCUs suitable for programming code & data into external flash at 0x8000_0000 or 0x9000_0000.

However currently this flash loader will fail to program the external flash if the flash has already been configured into OSPI mode (for example by application code that has previously been programmed into the internal flash).

This can lead to errors being displayed such as:

e2 studio :
image

J-Link log file : image

J-Link commander : image

This problem can be avoided by resetting the OSPI flash device into single bit mode before programming. This can be done using the JLinkScript file contained in the attached ZIP file : RA8x1_Reset_OSPI.zip. This uses the OM_Reset (P106) pin - which is expected to be connected from the RA8x1 MCU to the flash device - to trigger a reset of the flash.

If using e2 studio, this JLinkScript can be added to the launch configuration: image

If using other tools, see the information on SEGGER's wiki site : https://wiki.segger.com/J-Link_script_files#Using_J-Link_script_files

Alternatively, you can carry out an initialise operation in the RFP (Renesas Flash Programmer) tool to mass erase the MCU, and then do a full power on reset before attempting to program the OSPI flash device.