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.
Tool/software:
Hello,
I'm trying to run my code from flash memory on AM243 LP dev kit as it exceed RAM capacity. But when I tried set up my project acording to API doc https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/BOOTFLOW_XIP.html the code even as simple as LED blink examle is not running.
For CCS i'm using v 12.8 and SDK: mcu_plus_sdk_am243x_10_01_00_32
Here are setting I'm using:
And here is cfg I'm using for flashing
Is there any error in my settings or understanding how XiP should be executed?
Thanks
Best regards,
Jan
Hi Jan,
Thanks for your query.
I have taken your inputs and working on it. Please allow some time to revert back.
Regards,
Tushar
Hi Jan,
Can you please confirm, have you followed all the steps properly?
Have you kept the main symbol inside MSRAM memory?
Have you also kept the -llibsysbm.a<trgmsg.c.obj> (.text) inside MSRAM if CCS prints are used?
Please refer below image.
Regards,
Tushar
Hello Tushar,
Yes I followed these steps, but I’m not entirely sure if I did everything correctly.
For .text I have it in flash as I dont use debug functions and when I try to move it to MSRAM, nothing changes.
For main symbol I didn’t find any information about it so I’m only guessing. From what I know it should be in MSRAM as only .text a .rodata are in FLASH. Here are data from map file in which I can see that boot is in MSRAM
From .out file I can see that part of code is defined for MSRAM
Are there any steps I can make to be completely sure that I have set it up correctly?
Thanks.
Best regards,
Jan
Hi Jan,
Can you please share the example.syscfg file with us?
Also please tell us which example are you trying to run?
Regards,
Tushar
Hello Tushar,
Here is whole project with flash scripts I'm testing it with.
Best regards,
Jan
Hi Jan,
Thanks for sharing the above project.
I will try to replicate the issue at my end and will update.
Regards,
Tushar
Hi Jan,
I have found the root cause of the issue. The issue is coming because you have not set the proper configuration in example.syscfg file.
I can see that the .text.main was not allocated to the MSRAM memory. Also the MPU region was not marked as cached.
I am attaching the below project that has working changes. Please refer below project.
Project - gpio_led_blink_am243x-lp_r5fss0-0_nortos_ti-arm-clang.zip
Regards,
Tushar
Hi Jan,
Apart from the above mentioned changes you will also need to enable the OSPI DAC mode. To enable DAC mode, please follow below steps.
Make the below changes in ospi_am243x.syscfg.js file located at ${MCU+SDK}\source\sysconfig\drivers\.meta\ospi\soc\ospi_am243x.syscfg.js. Please refer below image.
After making the changes rebuild the drivers and SBL example using below command.
cd ${MCU+SDK}/source/drivers gmake -s -f makefile.am243x.r5f.ti-arm-clang PROFILE=debug clean gmake -s -f makefile.am243x.r5f.ti-arm-clang clean gmake -s -f makefile.am243x.r5f.ti-arm-clang PROFILE=debug gmake -s -f makefile.am243x.r5f.ti-arm-clang cd ${MCU+SDK} gmake -s sbl clean gmake -s sbl PROFILE=debug clean gmake -s sbl gmake -s sbl PROFILE=debug
After making the above changes rebuild the example application provided above. It should then be working fine.
Please let us know if the above solution works.
Regards,
Tushar
Hello Tushar,
I'm having some issues running gmake as it has wrong path for "C:/ti/ccs1281/ccs/utils/cygwin/rm".
In my file system I have ccs1280 not 1281 and I can't find way to change this path. Is there any way to change it?
Best regards,
Jan
Hi Jan,
You can change the path of CCS in the imports.mak file located at ${MCU+SDK}.
Regards,
Tushar
Hello Tushar,
I've tried your example and I can run it from CCS, but when I try to use it with sbl it doesn't start the program after power cyclce. I use sbl_ospi.cfg in FlashingTool file in project I shared but with new sbl files after recompiling SDK using commands you shared with me.
Best regards,
Jan
Hi Jan,
Are you able to see the complete SBL logs after powering the EVM?
Can you please send the logs from SBL?
Regards,
Tushar
Hello Tushar,
this is from 2 power cycles
When i use it without XiP to run from RAM it works fine.
Best regards,
Jan
Hi Jan,
Is the above error coming from SBL OSPI example's main.c file?
When i use it without XiP to run from RAM it works fine.
Are you trying to say when all code is kept inside MSRAM through Sysconfig?
Can you send complete logs when the SoC boots?
Regards,
Tushar
Hello Tushar,
Is the above error coming from SBL OSPI example's main.c file?
above error is from sbl_ospi.debug.hs_fs.tiimage from file SDK\tools\boot\sbl_prebuilt\am243x-lp
Are you trying to say when all code is kept inside MSRAM through Sysconfig?
yes
Can you send complete logs when the SoC boots?
This is all I get from UART, is there a other way to get more detailed log?
Best regards,
Jan
Hi Jan,
It seems your SBL example code itself is failing. Can you please confirm have you made any changes in the SBL example?
It seems to fails after the Drivers_open() call. Can you please debug the SBL example?
Please refer faq-am62x-am64x-faq-debugging-sbl-boot-in-rtos-sdk for details on debugging SBL.
Regards,
Tushar
Hello Tushar,
Sorry for late response.
I've tried reinstall SDK from https://www.ti.com/tool/MCU-PLUS-SDK-AM243X to make sure I have default files and tried run your example again with similar results. When I try to debug SBL I get stack on line 661 in sciclient.c
Where in this function which is called I get this:
When I tried to jump over this function I now don’t get any error with drivers_open but I get this to this line:
And now I get this log:
When I try using XiP example from mcu_plus_sdk_am243x_10_01_00_32\examples\kernel\dpl\xip_benchmark i get this errors:
. Is there any possible issue with me using CCS Version: 12.8.0.00012 with sysconfig version 1.22.0?
edit:
here is my SBL example project if it can help with resolving this issue
4812.sbl_ospi_am243x-lp_r5fss0-0_nortos_ti-arm-clang.zip
Best regards,
Jan
Hello Tushar,
I tried to get new versions of CCS and configure my setup according to software-dl.ti.com/.../GETTING_STARTED.html
When I tried running your commands and example again I still had to change imports paths even with everything installed to default paths. Is this behavior OK? Here is my imports.mak if it could be some issue there
and here is my TI root file
:
Best regards,
Jan
Hi Jan,
Can you please share the sbl_ospi.cfg file which you are using with us?
Regards,
Tushar
Hello Tushar,
I shered whole SBL project here
here is my SBL example project if it can help with resolving this issue
Best regards,
Jan
Hi Jan,
Thanks for sharing the above project. I will check this.
I was asking for sbl_ospi.cfg file not the SBL project. Can you please share the configuration file?
I will provide you mine SBL binary and cfg file which you can check at you end and update me with results.
Regards,
Tushar
Hi Jan,
Please refer below files.
SBL Binary - sbl_ospi.release.hs_fs.tiimage
Ospi Cfg - default_sbl_ospi.cfg
Regards,
Tushar
Hello Tushar,
I was asking for sbl_ospi.cfg file not the SBL project. Can you please share the configuration file?
Sorry i misunderstood here is cfg file
Best regards,
Jan
Hi Jan,
I have checked your cfg file and it looks okay.
Can you please check once with the files I have provided above?
Regards,
Tushar
Hello Tushar,
I tried using your bootloader got this from UART but LED is still not blinking:
When I tried connecting to MCU with debug it got to HwiP_user_undefined_handler_c. I'll do more debuging and will share results.
Best regards,
Jan
Hi Jan,
The SBL example is now working fine. Have you done any changes in the GPIO example?
Are you running mine GPIO example and still facing the issue? because on my end with the same binaries I can see LED blinking.
Regards,
Tushar
Hello Tushar,
I'm using your example without changes, And I'm getting HwiP_user_undefined_handler_c with first function call (System_init).
Could you share with me sbl_uart_uniflash? It's only bin right now that I'm using from downloaded SDK and not which you shared with me.
Best regards,
Jan
Hi Jan,
The uart uniflash is unlikely to create issue here.
Uart_uniflash - sbl_uart_uniflash.release.hs_fs.tiimage
Can you please check with different EVM's as well?
Regards,
Tushar
Hello Tushar,
I don't have second LP kit to try same binari od different HW. But I tried using XiP on TMDS243EVM. It's with different binaries but facing same issue with bootloader not working
Best regards,
Jan
Hi Jan,
In the project which I shared there might be prebuilt binaries also which is working for me. Can you try those binary in gpio example's Debug folder without recompiling?
I can see with the SBL binaries provided above you were able to run SBL, and your application is not running.
Can you try the steps mentioned at Debugging XIP Application to debug the GPIO application?
I will be out of office from tomorrow till next week's Friday. So responses to this thread will be delayed. Thanks for your patience.
Regards,
Tushar
Hello Tushar,
I did try uploading your binaries without recompilation. As for debuging GPIO application I had issued I mentioned where I get HwiP_user_undefined_handler_c with first function call in project.
Best regards,
Jan
Hello Tushar,
I've tried on second LP kit with same result. For loading application I do this steps:
Set UART boot mode
Load binaries using:
Then switch to SPI boot mode:
And this is boot log I get:
When i tried debug on both boards I got HwiP_user_undefined_handler_c when I tried to step into System_init();
Which is first function after blocking loop and I couln't find any information what could cause this behaviour.
Here are bineries I got shared here and flashing tools I use:
And those are board IDs I'm using if it could by faulty series
Best regards,
Jan
Hi Jan,
Thanks for your patience.
I have checked the above files the example is not working. I am providing the below zip where the example is working as expected.
Please check the below and update the results.
Files - flash_ti.zip
Regards,
Tushar
Hello Tushar,
I’ve managed to resolve this xip issue by moving only some parts of code to XiP. Thank you for your assistance and patience.
regards,
Jan
Hi Jan,
Thanks for the above confirmation.
Closing the thread.
Regards,
Tushar