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.
Hi,
To boot the TMS320F28388D from different sectors of flash, I know that I should change the OTP and EMU registers and of course I did it. I loaded two different applications in two different sectors of flash (Sector 0 and Sector 8) and I could successfully boot the DSP from these two sectors using one GPIO which has been assigned to a BSMP.
My question here is that, in the case of corrupted application written on the designated boot sector (e.g. Sector 0), can the DSP automatically change its own boot entry point to that of the next entry point (e.g. Sector 8) without changing the GPIOs or any hardware changes?
Here is the scenario that I want to implement:
Best,
Alex
Hi Alex,
- If the Application 1 (on sector 0) is corrupted, would (is there a way that) the DSP automatically switches to boot from Sector 8 instead?
Best,
What is the definition of corruption here ? BOOT ROM code does not do any check on programed image to know the validity of the code so you need to have something in application 1 which checks the validity of the code and if not valid then jumps to Application 2 but in this case we have to assume that code which is checking the validity of rest of the code is no corrupted. We have secure boot option where BOOTCODE checks the validity of the code before jumping to it but it does not have feature to jump to another application incase of failure.
Regards,
Vivek Singh
Hi Vivek,
Thank you for your reply. Based on your explanation, if there is an Application 1 that can checks the validity of the code and if not valid then jumps to Application 2, it would be useful for me and solves my issue.
So, I consider the following scenario regarding your explanation:
How can I implement the Step 6? Are there any examples or documentations for that?
Best,
Alex
How can I implement the Step 6? Are there any examples or documentations for that?
Best,
When I say boot from application 2, it simply means jump to entry point of application 2. On check the code validity, there are different ways to check it. You can store the golden CRC and check run time CRC with golden CRC. We also have ECC on flash which can generate ECC error if corruption is due some bit flip. We may not have example with exact same usecase what you have but we may have CRC examples. I can check with SW team and get back to you.
Regards,
Vivek Singh
Thanks Vivek for your quick reply.
When I say boot from application 2, it simply means jump to entry point of application 2.
I am not sure how exactly can we jump to the entry point of application 2 while application 1 is running. Also, when we jump to the entry point of application 2, does it mean that the DSP will soft-reset and boot from the new entry point? This could potentially solve my issue. Could you please explain a little more how this would work? Any additional links/examples would be very helpful.
Best,
Alex
No soft reset because soft reset will force the boot entry point to application 1 again. We do not have way to jump to different point without changing the boot mode pins hence I was suggesting the workaround. Let me connect you to our BOOT ROM expert to help further.
Regards,
Vivek Singh
In your application 1 when you decide that application 1 is corrupted you needed to jump to application 2 entry point. Below is the reference code for doing that,
void(*fun_ptr)(void) = “Application 2 entry_addr”;
(*fun_ptr)();
Thank you Vivek and Baskaran for your replies. In my application 1, after I copied Application 2 into the flash (In the Sector 0 = 0x00080000), I implemented the code that you mentioned to jump to Application 2. But after doing this, it does not boot from the Application 2 or even does not run the Application 2. It always gets stuck in the address 0x82f38 and I don't know what is this address.
Could you please guide me what is the problem and how can I boot from Application 2 when the application 1 is running? Maybe there is something that I have to consider.
Best,
Alex
Could you please help me in this issue? This inquiry is urgent for me.
Thanks,
Alex
Alex,
Are you able to connect to CCS and step through this code to see when it jumps to address 0x82f38 ? Do you have WD disable in your application to make sure it does not times out and issue a reset.
Regards,
Vivek Singh
Hi Vivek,
Thank you for your reply.
Do you have WD disable in your application to make sure it does not times out and issue a reset.
The first function that I call in the main function is "SysCtl_disableWatchdog()" function which runs the following line:
HWREGH(WD_BASE + SYSCTL_O_WDCR) |= SYSCTL_WD_CHKBITS | SYSCTL_WDCR_WDDIS;
Is it right?
Are you able to connect to CCS and step through this code to see when it jumps to address 0x82f38 ?
I am running these two lines in the main function:
1- boot();
2- (*fun_ptr)();
The first one copies a hex application into the Sector 0 of flash memory (0x00080000) and the second one is the code that Baskaran mentioned that I have to use to jump to the beginning of Sector 0 of flash memory (0x00080000). When I run this code using CCS debug mode, I can see the memory browser that the hex application is copied successfully into the flash. But, after executing the line "(*fun_ptr)();", the code will be stuck at the address 0x082F38.
Best,
Alex
Hi,
Could anyone guide me to solve this issue? It has been 2 weeks and I did not receive any answers from your side.
I just want to make sure that:
1- Can I "boot" the DSP from the desired entry point in Flash memory while the current code is being run from another entry point of Flash memory without changing GPIOs or any hardware changes?
2- If the answer of question one is yes, how can I exactly do that?
(Although you mentioned that how I can jump to another entry point, as I mentioned before in my previous posts, it stuck in the address 0x082F38).
I am looking forward to hearing from you.
Best,
Alex
To be more specific, I wanted to add this:
You suggested the option of jumping to another entry point. I did so, but it gets stuck in the address 0x082F38. My questions:
1- Could you please explain more or send a reference to know what exactly happens or should happen when the processor gets that address?
2- If we jumped to the entry point of Application 2, does it mean that after loading application 1, then the application 2 would be loaded as if it were the only application loaded in the DSP?
I look forward to your reply.
Best,
Alex
Hi Vivek,
I have been waiting for you for many days. Would you please more elaborate on the solution that you have already mentioned in previous posts?
Thanks,
Alex
1. when the function pointer is invoked the cpu should start executing the application 2's code. Is the control reaching to the main function of application 2 ?
0x082F38 - i dont know what this address corresponds to in your application. It will be easy if you can connect debugger and check the execution of application 2.
2. if you jump to application 2, still both application will be present in Flash memory. But your logic will find that application 1 is corrupted and will always jump to application 2.
when the function pointer is invoked the cpu should start executing the application 2's code. Is the control reaching to the main function of application 2 ?
It just gets stuck at that address of Flash memory.
0x082F38 - i dont know what this address corresponds to in your application. It will be easy if you can connect debugger and check the execution of application 2.
It is an address in the Flash memory which application 2 has been copied on.