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.

AM261-SOM-EVM: Am261x LP: Profinet device demo issues.

Part Number: AM261-SOM-EVM
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG

Hello!

I am trying to run the Profinet device demo from Industrial communication SDK (2025.00.00.08) on TI Am261x LaunchPad revision A. I tried to run it as it is without any modifications but I was getting HwiP_prefetch_abort_handler exception right after start, so it seemed that there is a problem with the XIP. I changed (based on the Hello world XIP example):

  • sys-cfg->MPU->CONFIG_MPU_FLASH->Region start address from 0x60000000 to 0x80000000
  • sys-cfg->Memory Region->Added FLASH_FSS1 region - start address 0x80100000
  • sys-cfg->Section-Load and Run memory of text_flash section changed to FLASH_FSS1.

After these changes there was no exception, but the app initialization was freezing after reset during the first EEPROM read. It got stuck in SemaphoreP_pend in I2C transfer, while waiting for the tranfer to be finished..

I saw somewhere in the forums that I have to modify PN_APP_IOD_remaInit to have the NVM_APP_init task init after the first NVM_APP_read(). After this change couple of EEPROM reads passed and then it got stuck in the EEPROM read in APP_HW_BOARD_INFO_read. It got stuck in the same way, but it is important to note that it got stuck during the second call to this function, the first MAC read was OK (APP_HW_BOARD_INFO_read is called twice, once from bsp_init and a second time from APP_pruInit).

After that I just commented the MAC read and hardcoded one. WIth this the stack initialization was completed and I even was able to see a profinet device in Proneta. However, it is unstable, probably due to all of the changes that I made.

My questions:

  1. Are my changes in sys config for the XIP correct? Additionally is it OK to use TCMB memory for RL2 caching?
  2. Are you aware what is the issue with the EEPROM reading? It is not I2C bus issue, as I mentioned sometimes the reading is OK. I am also getting the same behavior on two separate LPs.
  3. Are there any other know issues in the PN example that I must work around?
  • Hello dear,

    Our example should work out of the box without any modifications 

    we will look into this issue in details, but before that would you please clarify how did you flash the board? We recommend using Uniflash application (GUI). If you're using it and still getting these issues, please send me screenshots of what you have done on Uniflash application.

    Also please make sure to use example.syscfg file to build the project (not example-rev-e2.syscfg).

    Kind regards,
    Kamil

  • Hello!

    I am using the correct example.syscfg, not example-rev-e2.syscfg.

    I am programming the flash via the SBL and UartXModemLoader script. I dumped the flash and I verified that the correct data is written on it. Also, I can see via the debugger that the data is present in the external flash and I am executing correct code from it and XIP.

    One bit that is confusing for me is that XIP is working only when I am using FSS1 (start address 0x80000000), while I think that the SBL is using FSS0 (starting from 0x60000000). However, I was not able to get the PN example starting with using 0x60000000, XIP is working only with 0x80000000. Can you please clarify that?

    Additionally, have you seen any of the issues with the EEPROM reading, that I described above? The same behavior I can also see on another colleague's desk on his set up. I don't see how this can be related with the way I program the flash, this part of the code is executed from OCRAM.

    Best regards!

  • Hello Vasil,

    we have not had any of the issues you are reporting with our EEPROM access. Looking at the diff between your failing scenario and our passing one:
    A. We are flashing the image using Uniflash GUI rather than a script (this was previously advised by the responsible team)
    B. We're flashing SBL at 0x60000000, app mcefl image at 0x60081000, app mcelf_xip image at 0xE0000000.

    So we are not shifting our image to FSS1 and yet everything works fine. Therefore, as a first step, I advise you to do the same on your side (using Uniflash GUI).

    In parallel, would you please share the following so I can investigate this further with the responsible team?

    1. Sysconfig file
    2. UartXModemLoader script
    3. SBL config file
    4. The command you are executing for flashing the board

    Kind regards,
    Kamil

  • Hi Kamil!

    Sorry for not responding for so long, I was in vacation. I attached the requested files. Regarding the command that I am using for flashing, first I send command to the SBL to have flash_address 0x100000, then I use UartXModemLoade to download the binary. I want to highlight couple of points on why this is not related to XIP, uniflash, etc...:

    1. If I don't use the FSS1 and go with FSS0 I get HwiP_prefetch_abort_handler exception at start up. Probably I must do something additionally in the SBL.

    2. XIP is working as expected when I use FSS1, I am 100% able to execute code from Flash. 

    3. After I get the XIP working I am not able to proceed because of the EEPROM read issue. Here are more details about it.

    If I don't change the source of he example it fails during the first EEPROM read in PN_APP_IOD_remaInit(). It fails due to issue with the I2C transfer. There is a receive overrun (RSFULL = 1), the whole value of I2C_ICSTR is 0x00001C18.

    As I mentioned, if I modify PN_APP_IOD_remaInit to have the NVM_APP_init task init after the first NVM_APP_read() I am able to get couple of successful EEPROM reads (It reads correctly revision A ID of the LP), but the last reads fail with the same I2C issue.

    PN_files.zip

    It is very important to note that the same behavior happens on more than 1 launch pads. Obviously the I2C connection is not the problem, because I am able to read the EEPROM with other examples (so far I have the ethercat, cpsw_enet, xip, ipc examples without issues). Even with this one I can read from it, when I rearrange the sequence. I also do not see how this could be related to XIP, all of this code is executed from OCRAM. Are you sure that such issues were never reported before?

    Best regards!

  • Hi Vasil,

    thanks for following up.

    I want to assist you with the points you mention but first I need to understand why your board did not work out of the box. All the modifications you have done are not needed for the default application to run successfully. 

    If you build your program based on the default sysconfig provided within the example folder, a linker.cmd file will be generated and used for the build. I took a quick look at the files you shared and I see that the linker.cmd file you shared does not correspond to the sysconfig file. You seem to have made many manual adjustments to this file. Heap size is greatly reduced, TCMA sections are moved to RAM, etc. Would you please explain?

    Additionally I would like to know, where did you get the UartXModemLoader.py file from? I can't find it in the MCU+ SDK.

    Kind regards,
    Kamil

  • Hi Kamil!

    The linker.cmd file that you looked at is the one from the SBL (the SBL_syscfg directory contains only SBL files, not ones from the PN example). As requested, I sent the SBL sys cfg files and I also sent the example.cfg from the modified PN example. The only adjustments in the PN example.syscfg file are the ones I listed above.

    Let me clarify something. Some of the LPs on our side are modified to be able to debug them with j-link. I am flashing the SBL and the XIP part of the PN example with Xmodem and I am debugging/programing the RAM part with segger j-link. With this approach I did not have any issues with the examples that I listed in my previous comment.

    However, I also have LPs which are not modified at all and I can use them with CCS. I can try with it, but I have couple of questions in this case. The SBL does the OSPI configuration and enables DAC mode for XIP, right? Which version of the SBL from the SDK  should I use for this test?

    Regarding the UartXModemLoader.py, it was given to me by the colleague that built the SBL. I'll check tomorrow with him where did he get it from and I'll let you know.

  • Hi Vasil,

    let's try the default way and see if it works:
    1. Install Uniflash program
    2. Connect the AM261-LP and run the program
    3. Set the boot switches to OSPI mode
    4. Choose the files as in the below picture (SBL is found under mcu_plus_sdk_am261x_11_00_00_29\tools\boot\sbl_prebuilt\am261x-lp)
    5. Load the program and verify it's running. 



    P.s. please build the application images (mcelf and mcelf_xip) based on the default demo app without any changes in the sysconfig.

    Let's first make sure that this works then we can discuss further details.

    Thank you.
    Kind regards,
    Kamil

  • Hi Kamil!

    I tried this, but the application is not even starting. I used the default PN example, without any changes on an out of the box LP.

    I checked the serial output and it seems that after programming the execution stays in the RBL (you can see the output in the attached screenshot).

    Is there a way to connect with CCS to see why the application is not loading?

    In the zip fail you'll find - screenshot of the serial output, screenshot of the uniflash setup, picture of the LP set up, text file with the uniflash's console output.

    Best regards!PN debug.zip

  • At least the addresses in uniflash look wrong. Can you tell me how to change them?

  • Hi Vasil,

    the address you highlighted in the picture is not wrong. It is just a pre-defined value to tell the flashing tool that the flash offset for the XIP image is specified within the image itself. 

    Based on what you shared, I see you have selected the wrong boot mode. Please select the OSPI boot mode (1100 or 0011) and try again. If it still does not work, please reshare a screenshot of the serial output.

    Kind regards,
    Kamil