This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM243X: Custom flash with 1S-1S-4S protocol not working

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: SYSCONFIG

Hello experts,

I'm developing support for custom flash device "MX25L12833FM2I-10G".

I'm having troubles using the flash in 1S-1S-4S.

I managed to configure correctly the flash in the 1S-1S-4S protocol. After configuration the bit6 (QE, quad enable) of the status word is set correctly and the amount of dummy cycles is set to 10 (bit6/7 of configuration register), as shown in the image, where cfgReg = configuration register and statReg = status register.

The problem occurs when I execute a QREAD command (0x6B):

I'm using the ospi_flash_io example provided by the SDK, where it writes an array of values to the flash (from 0 to 255 in crescent order) and then reads back this values.

In the read buffer I'm getting this values instead:

This response from the flash makes me wonder if all the 4 spi pins (D0,D1,D2,D3) are actually being used or if I'm missing something the the peripheral configuration.

Here you can find the sysconfig file from my project 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "AM243x_ALX_beta" --package "ALX" --part "ALX" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM243x@09.00.00"
* @versions {"tool":"1.18.0+3266"}
*/
/**
* Import the modules used in this configuration.
*/
const flash = scripting.addModule("/board/flash/flash", {}, false);
const flash1 = flash.addInstance();
const clock = scripting.addModule("/kernel/dpl/clock");
const debug_log = scripting.addModule("/kernel/dpl/debug_log");
const mpu_armv7 = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
const mpu_armv71 = mpu_armv7.addInstance();
const mpu_armv72 = mpu_armv7.addInstance();
const mpu_armv73 = mpu_armv7.addInstance();
const mpu_armv74 = mpu_armv7.addInstance();
/**
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thank you in advance,

Best Regards,

Andrea F,

  • Hi Andrea,

    how did you import the flash configuration into sysconfig? the instructions on the different ways of doing this can be found on AM243x MCU+ SDK: Adding Support For a Custom Flash Device (ti.com)

    Please go over this first to verify if it is not a problem with the sysconfig parameters. Also please verify that the device id printed out by the diag example matches with the expected one from the datasheet.

    Best,

    Daniel 

  • Hi Daniel,

    I've already used the guide you suggested to implement the configuration into sysconfig. I used the ospi_flash_diag example to get the JSON description of the flash and manually fixed some values that didn't match with the flash datasheet.

    After checking the device id, as you suggested, I noticed that the value doesn't match with the datasheet:

    The datasheet says that Electronic ID is 0x17

    The ospi_flash_diag example reads Flash Device ID: 0x2018.

    I checked inside the driver ospi_nor_flash.c and the MCU sends the 0x9F command to the flash, meanwhile this flash has Manifacturer and Device ID in the command 0x90.
    This mistaken read shouldn't cause any problem although, because the same command (0x9F) is used when the ID check is done during the flash initialization.

    The flash is already working on 1S-1S-1S with read command 0x03 and 0x0b.

    Best Regards,

    Andrea

  • After better checking the flash datasheet the full Device ID is 0x2018, this means that the ospi_flash_diag example is reading the correct Device ID

  • Hi Andrea,

    It is possible then that the failure is coming from a faulty octal initialization sequence for this particular flash device. We have actually observed similar behavior in the past and we are currently investigating to resolve this problem. I mention this briefly in this open thread: (+) MCU-PLUS-SDK-AM243X: 2434 EVM OSPI FLASH DIAG error - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    My suggestion is the same in this case, is it possible for you to use a different device?

    Best,

    Daniel