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.

AM263P4-Q1: Flashing custom board

Part Number: AM263P4-Q1
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG

Tool/software:

Hey Experts,

ive a question regarding flashing my custom board. 
As flash iam using the IS25LX064 (same as at eval boards just with 64mb ram instead of 256mb)

As SW i am using:
CCS 12.8.1.00005
SDK 10_00_00_35
Uniflash 8.8.1.4983

At first i read this guide: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/latest/exports/docs/api_guide_am263px/CUSTOM_FLASH_SUPPORT_GUIDE.html and run the ospi flash diagnostic example with the following output:

Cortex_R5_0] [OSPI Flash Diagnostic Test] Starting ...

[OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0x9D

[OSPI Flash Diagnostic Test] Flash Device ID       : 0x5A17

[OSPI Flash Diagnostic Test] Executing Flash Erase on first block...

[OSPI Flash Diagnostic Test] Done !!!

[OSPI Flash Diagnostic Test] Performing Write-Read Test...

[OSPI Flash Diagnostic Test] Write-Read Test Passed!

[QSPI Flash Diagnostic Test] SFDP Information :

================================================

                      SFDP                     

================================================

SFDP Major Revision                       : 0x1

SFDP Minor Revision                       : 0x9

Number of Parameter Headers in this Table : 3

 

Types of Additional Parameter Tables in this flash

---------------------------------------------------

4 BYTE ADDRESSING MODE INSTRUCTIONS TABLE

NOR SPI PROFILE TABLE

JSON Data for the flash :

 

{

 

"flashSize": 8388608,

"flashPageSize": 256,

"flashManfId": "0x9D",

"flashDeviceId": "0x5A17",

"flashBlockSize": 131072,

"flashSectorSize": 4096,

"cmdBlockErase3B": "0xD8",

"cmdBlockErase4B": "0xDC",

"cmdSectorErase3B": "0x20",

"cmdSectorErase4B": "0x21",

"protos": {

"p111": {

"isDtr": false,

"cmdRd": "0x03",

"cmdWr": "0x02",

"modeClksCmd": 0,

"modeClksRd": 0,

"dummyClksCmd": 0,

"dummyClksRd": 0,

"enableType": "0",

"enableSeq": "0x00",

"dummyCfg": null,

"protoCfg": null,

"strDtrCfg": null

},

"p112": null,

"p114": null,

"p118": {

"isDtr": false,

"cmdRd": "0x7C",

"cmdWr": "0x84",

"modeClksCmd": 0,

"modeClksRd": 1,

"dummyClksCmd": 0,

"dummyClksRd": 7,

"enableType": "0",

"enableSeq": "0x00",

"dummyCfg": null,

"protoCfg": null,

"strDtrCfg": null

},

"p444s": null,

"p444d": null,

"p888s": null,

"p888d": {

"isDtr": false,

"cmdRd": "0x0B",

"cmdWr": "0x12",

"modeClksCmd": 0,

"modeClksRd": 0,

"dummyClksCmd": 8,

"dummyClksRd": 32,

"enableType": "0",

"enableSeq": "0x00",

"dummyCfg": {

"isAddrReg": false,

"cmdRegRd":"0x00",

"cmdRegWr":"0x00",

"cfgReg":"0x00000000",

"shift":0,

"mask":"0x00",

"bitP":31

},

"protoCfg": {

"isAddrReg": false,

"cmdRegRd": "0x00",

"cmdRegWr": "0x00",

"cfgReg": "0x00000000",

"shift": 0,

"mask": "0x00",

"bitP": 0

},

"strDtrCfg": {

"isAddrReg": false,

"cmdRegRd": "0x00",

"cmdRegWr": "0x00",

"cfgReg": "0x00000000",

"shift": 0,

"mask": "0x00",

"bitP": 0

}

},

"pCustom": {

"fxn": null

}

},

"addrByteSupport": "1",

"fourByteAddrEnSeq": "0x22",

"cmdExtType": "REPEAT",

"resetType": "0x30",

"deviceBusyType": "0",

"cmdWren": "0x06",

"cmdRdsr": "0x05",

"srWip":  0,

"srWel":  0,

"cmdChipErase": "0xC7",

"rdIdSettings": {

"cmd": "0x9F",

"numBytes": 5,

"dummy4": 0,

"dummy8": 0

},

"xspiWipRdCmd": "0x00",

"xspiWipReg": "0x00000000",

"xspiWipBit": 0,

"flashDeviceBusyTimeout": 20000000,

"flashPageProgTimeout": 120

}

 

All tests have passed!!

That done i conclude my flash is connected correctly?
I only wonder why this differs to the jason data provided in the sdk(see attached file).

After that i took the flasher_jtag_uniflash_am263px-lp example, adapted the pinning in sysconfig and changed the flash settings ( just ID and size, if i changed other parameters it wont function anymore)

Then i took the Uniflashtool, chose the cosum flasher with the correct path to my adapted lasher_jtag_uniflash_am263px-lp example and flashed a adapted sbl_ospi and my application:

Here iam not quite sure what defines at which adress the external flash is located. I just took the adresses i used when i tested it at the am263p-cc eval board. 
When i load the files uniflash says flashing was okay:

but when i try to read the memory at adress 0x60000000 there are just zeros. So nothing was written there.

Any ideas of what iam doing wrong?

Best regards

Marcel

 

  • Hi Marcel,

    There are some changes that you need to make in the flash configuration in Sysconfig. 

    To validate that the flash is working properly, we can use ospi_flash_io example in examples/drivers/ospi/ospi_flash_io.

    Before changing the flash configurations, run the diagnostics example on your flash and note down the SFDP table.

    Please follows the steps below,

    1. Open the ospi_flash_io example in the SDK (make sure that all the settings are intact, none of the configurations in sysconfig is changed). Additionally, you can make sure that it works on the launchpad.

    2. Open the Flash Drivers Section in Sysconfig. (Sysconfig > TI Drivers > Flash)

    3. Change the Flash Size in Flash > Basic Flash Configuration > Flash Size in Bytes as in the SFDP table

    4. Change Flash JEDEC manufacturer ID and JEDEC Device ID as in the SFDP table

    5. Change Flash Busy Timeout as in the SFDP table

    6. Other configurations can be left as it was before.

    Now run the example, If the success message comes in the console/serial terminal, then we are able to write and read into flash. By this method, flash read and write can be validated.

    [NOTE: While changing these configurations, these is a chance that the OSPI output pins would change automatically. Make sure that the pins are locked before reconfiguring and very again once done.]

    I do not have the 64Mb flash but the 512Mb flash with me and validated the same here my making these changes. 

    Also, the file does not seem to be attached. Can you attach it again?

    Regards,

    Aswin

  • but when i try to read the memory at adress 0x60000000 there are just zeros. So nothing was written there.

    Any ideas of what iam doing wrong?

    How are you reading the memory?

  • Iam using the Uniflashtool:

  • Hi Marcel,

    Seems like a issue with Uniflash tool,

    I have the SBL NULL flashed at 0x60000000 location and as you can see in COM port print. even then Uniflash is showing 0x0 at the location which is incorrect.

    Use flash read API to read flash content in application 

  • I have flashed SBL OSPI and hello world and when I check from memory browser in CCS, I am able to see the correct content.

  • THis is the jason file for the flash from sdk that i wanted to uplode in my last post:

    {

    "flashSize": 8388608,
    "flashPageSize": 256,
    "flashManfId": "0x9D",
    "flashDeviceId": "0x5A17",
    "flashBlockSize": 131072,
    "flashSectorSize": 4096,
    "cmdBlockErase3B": "0xD8",
    "cmdBlockErase4B": "0xDC",
    "cmdSectorErase3B": "0x20",
    "cmdSectorErase4B": "0x21",
    "protos": {
    "p111": {
    "isDtr": false,
    "cmdRd": "0x03",
    "cmdWr": "0x02",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    "dummyClksRd": 0,
    "enableType": "0",
    "enableSeq": "0x00",
    "dummyCfg": null,
    "protoCfg": null,
    "strDtrCfg": null
    },
    "p112": null,
    "p114": null,
    "p118": {
    "isDtr": false,
    "cmdRd": "0x7C",
    "cmdWr": "0x84",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 0,
    "dummyClksRd": 7,
    "enableType": "0",
    "enableSeq": "0x00",
    "dummyCfg": null,
    "protoCfg": null,
    "strDtrCfg": null
    },
    "p444s": null,
    "p444d": null,
    "p888s": null,
    "p888d": {
    "isDtr": false,
    "cmdRd": "0x7C",
    "cmdWr": "0x84",
    "modeClksCmd": 0,
    "modeClksRd": 0,
    "dummyClksCmd": 16,
    "dummyClksRd": 16,
    "enableType": "0",
    "enableSeq": "0x00",
    "dummyCfg": {
    "isAddrReg": true,
    "cmdRegRd":"0x85",
    "cmdRegWr":"0x81",
    "cfgReg": "1",
    "shift":0,
    "mask":"0xFF",
    "bitP":16
    },
    "protoCfg": {
    "isAddrReg": true,
    "cmdRegRd": "0x85",
    "cmdRegWr": "0x81",
    "cfgReg": "0",
    "shift": 0,
    "mask": "0xff",
    "bitP": 231
    },
    "strDtrCfg": {
    "isAddrReg": true,
    "cmdRegRd": "0x85",
    "cmdRegWr": "0x81",
    "cfgReg": "0x00000000",
    "shift": 255,
    "mask": 255,
    "bitP": 0
    }
    },
    "pCustom": {
    "fxn": null
    }
    },
    "addrByteSupport": "1",
    "fourByteAddrEnSeq": "0xA1",
    "cmdExtType": "REPEAT",
    "resetType": "0x30",
    "deviceBusyType": "0",
    "cmdWren": "0x06",
    "cmdRdsr": "0x05",
    "srWip": 0,
    "srWel": 1,
    "cmdChipErase": "0xC7",
    "rdIdSettings": {
    "cmd": "0x9F",
    "numBytes": 5,
    "dummy4": 0,
    "dummy8": 8,
    "addressBytesSize": 0
    },
    "xspiWipRdCmd": "0x00",
    "xspiWipReg": "0x00000000",
    "xspiWipBit": 0,
    "flashDeviceBusyTimeout": 72000000,
    "flashPageProgTimeout": 120
    }

    I tried the ospi_flash_io example you mentioned. I addapted the flash section. Additionaly i changed the Reset pin and the OSPI pins regarding my Board:
     


    I run the code in debug and all tests passed!

    So reading and writing was possible.

    Regards,
    Marcel

  • Your screenshot shows adress 0x0 and not 0x60000000

  • So you flashed with the Uniflash tool. How did you get to the memory browser? If you hit the debug another project you flash it aswell arent you?

  • Hi Marcel,

    Once you have flashed with the uniflasher tool, you can open code composer studio and launch a target configuration. Connect the core and then open the memory browser from the View option.

    You can follow this method to see the memory contents. There is no need to debug/flash another project.

    Regards

    Aswin

  • Hi Marcel,

    Since you can now read and write into the flash, you can use the same flash configurations for the flasher.out as well.

    You may now flash using uniflash tool with the modified flasher.out file. To read the contents, follow the memory browser approach.

    Regards,

    Aswin

  • Hey Aswin,

    ive just repeated the steps again.
    I took the flasher_jtag_uniflash_am263px-lp example, changed the OSPI pinning and the flash configuration like i did in the ospi_flash_io example.




    Then i powercycled my board and used the Uniflashtool to flash (costum flasher used):

    After that i launched my target config and opened the memory view and still the only thing i see are zeros:


    Can it be a problem with the adresses i use?
    Do you have any other ideas, what i can test?

    Best regards,

    Marcel

  • Hi Marcel, 

    Can you confirm if the application is running? Is the issue only with reading the contents?

    Regards,

    Aswin

  • Hey Aswin,

    no the issue is not only with reading the contents.
    Application is not running after flashing.

    Regards,

    Marcel

  • Hi Marcel, 

    Could you confirm if you have adapted the Flash configuration for SBL as well. Are you using the prebuilt SBL?

    I changed the flasher and SBL configuration for a different flash and tested it by flashing a hello world example and was able to read and run the application.

    Regards,

    Aswin

  • Hey Aswin,

    i took the sbl_ospi_am263px-lp_r5fss0-0_nortos_ti-arm-clang importet it into my workspace and changed the Flash configuration and the OSPI pinning aswell.
    Nevertheless regardless of what iam flashing, i would asume to see something when i read out the memory.
    I just testet it with my am263p-cc. I flashed different files and tried to read out the memory with uniflash. I just worked like it should.

    Best regards,

    Marcel

  • Hey Aswin,

    just tested something new.
    With my am263p-cc eval board i tried to flash with uniflash, but with costum flasher.
    There i first tried to build the jtag_uniflash for cc without any changes and took it to flash. Flash process didn't work with uniflash.
    So i took the prebuild version. And here i have the same result like with my costum board. Only zeros in memory

    Best regards,

    Marcel

  • Hi Marcel,

    Can we use a different method to flash into the device to see if the problem persists. 

    Can you use UART flasher method. You can find the steps to perform flashing via UART here.

    See the section Basic Steps to flash files under UART Uniflash. Be sure to use the updated flasher and SBL files.

    Regards,

    Aswin

  • Hey Aswin,
    just tested it with my evalboard because there its easier to switch bootmodes.
    It just functions but when i chose custom flasher it didn't.

    What file did you take as custom flasher?
    Do i just have to name the path to costum flasher and nothing else?


    Best regards,

    Marcel

  • Hi Marcel,

    Please follow the steps to flash using custom flasher.

    1. The custom flasher image needs to be built by the user. For this, open the project mcu_plus_sdk_am263px_10_00_00_35/tools/flasher/jtag_uniflash project in code composer studio. 

    2. After making the changes to flash configuration in sysconfig (if required) build the project. You will get an .out file. This .out file is the flasher file that you need to mention in the custom flasher option in uniflash. Make sure that the pin configurations and flash configurations are correct.

    3. Now check the Custom Flasher checkbox and mention the path and the file name of this .out file in uniflash. Please see the attached screensnip.

    I have mentioned the path and the file name of the .out file. 

    4. Now load the SBL and Application. I have loaded the SBL after adapting the flash configuration to my flash device in sysconfig.

    5. The device should be flashed after pressing Load Images button. 

    You can flash the device by keeping it in OSPI/DevBoot Mode. Also, it is recommended to use the latest version of uniflash.

    Regards,

    Aswin

  • Hey Aswin,
    sorry for the late reply, i was ooo the last week.
    In the past i couldn't change the bootmode of my costum board, so i was always in dev bootmode.
    To check if flashing was succesfull my only option was to check the memory.
    Today i could change the bootmode to ospi. Flashing was successfull and it booted correctly to my code.
    Iam not quite sure if looking in the memory was not successfull in the past or why it functions now, but thanks for the support and i think we can close this issue.

    Best regards,

    Marcel

  • Hi Marcel,

    Glad to hear that it worked. 

    Regards,

    Aswin