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.

RTOS in TMS570LC4357

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN, UNIFLASH

Hi TI,


In HalcoGen I generate FREERTOS Project for TMS570LC4357. In that I cannot make modification in R5-MPU-PMU tab.

And If I burn my code into the micro controller, It can not start working. It shows the following error while burning the code itself.

After this window comes, I can not do clicking start or pause icons.(See the above image). These icons are not enabled. So then I tried to burn any other working code. At that time following error occurred.

So to overcome this what I did is,

1. Holding the SYS_Reset button in the kit.

2. releasing that button when exactly the debugger do accessing TMS570LC4357.

 After doing this my working code was loaded into the micro controller. And works fine only.

But my RTOS code is not even get  loaded into micro controller and shows the same error sequence again and again.

Please anybody guide me where I fails.

Thanks in advance.

Regards,

Karthikeyan.K

  • Hello Karthik,

      Are you trying to use the example_freeRTOBlinky example from the HalcoGen?

  • Hai Charles,

    Yes of-course. I tried to use example_freeRTOSBlinky example. But I could not. Very first time, my code was being loaded into the TMS570LC4357. But immediately after then I could not neither same project nor any other project.

    Please help me in making use of it and I also to recover my IC.

    Thanks in advance,

    Regards,

    Karthikeyan.K

  • Hi Karthikeyan

    I did a quick check on the example_freeRTOSBlinky and it works fine. I tried loading the code multiple times and I was not able to reproduce the issue you are facing. 

    Can you do the Steps you mentioned in your older Post to connect and have the device Erased, this is to make sure no code resides on the Flash. ( Tools --> Debugger Options --> Erase ). Let me know if you could never connect.

    Are you noticing the ESM error LED on? 

  • Could you also share the complete CCS project files with me, to see if the code is causing the device not to connect.

  • Hai Prathap!

    Thanks for your support.

    Here I have attached my entire project file.

    I couldn't even erase my IC after I burn this code. Please do some help.

    If you cannot reproduce the error, kindly do the following steps.

    1. After verifying everything is fine (Sorry sir!. Because your IC also may get locked. That's why.), Build this project and burn in your IC.

    (Kindly Be sure that everything is fine, or else you may also get into this problem.)

    2. Click the Run Icon from the debugger window for 2-3 seconds.

    3. Click the Stop Icon to come out of debugger mode.

    4. Now try to burn the same project again. This time You can not burn.

    (And Yes sir, ESM error RED LED is ON)

    Please kindly don't get into trouble for the sake of helping me.

    But any ways, please help me Sir.

    2577.RTOS_TMS570LC4357.zip

    Thanks in advance.

    Regards,

    Karthikeyan.K

  • Hai Prathap!

    I find a way to recover my IC. Actually I cannot erase my entire Flash memory.
    And I doubted about MPU. It is the culprit who keeps me away from re-write the flash memory. And yesterday, from the Memory Browser window, I had noticed that _mpuInit_() function is placed in 0x11454 th location of Flash memory. So I decided to at least erase this location alone.
    So I tried a sector erase using UniFlash for the following sectors:

    1. sector 3 - 2% only erased, after that erasing is failed and my IC keeps running the previous code.
    2. sector 4 - 5% only erased, after that erasing is failed and my IC keeps running the previous code.
    3. sector 5 - 7% only erased, after that erasing is failed and my IC stops from running the previous code (i.e: Halted).
    4. Now without affecting this Halt state, I tried to burn other working code (which will not lock my IC). Now I can re-burn.

    But anyway, I cannot utilize HalcoGen RTOS code. Please help me in making HalcoGen RTOS code working.

    Thanks in advance.

    Regards,
    Karthikeyan.K
  • Hai Prathap!

    I make this code working by making simple modification in HalcoGen.
    In the R5-MPU-PMU tab,
    I manually enable Region 11 & 12 with PRIV_RW_USER_RW_EXEC permission and make these regions as
    Region 11 --> 0x00000000 to 0x003FFFFF
    Region 12 --> 0xF0200000 to 0xF021FFFF

    After making this change, I can re-burn my IC.
    And the RTOS code also working fine.

    But My doubt is whether my change is correct or not?
    Because Flash memory is protected in default in the HalcoGen. And I cannot modify the setting manually even by-mistake.
    So HalcoGen team make these memory regions protected. So I may wrong in these steps. But my code works fine. I thought like, instead of finding the actual solution, I find another solution which solves my problem but also may or may not cause additional problems.

    I am in confusion. Please guide me sir.

    Thanks in advance.

    Regards,
    Karthikeyan.K
  • Karthik, Prathap,
    I also notice that if I do a cache flush first, then it will always work. I created the HalcoGen example_RTOSBlinky project and it will not program/erase after the code has successfully run the first time. After it fails to program/erase, if you try to flash again then it will work.
  • Hi Prathap, Charles!

    My trick to prevent the RTOS code from proventing me to re-write is not working as I said. It is still preventing me to re-write my IC one the same code is successfully run. But fortunately I can recover my IC by the steps I said above.

    So Prathap Sir! Do you find the mistake I made in my code?
    I have shared my Code already with you.

    So Charles!. I am sorry sir. I can not understand what you meant by cache flush? Are you calling "Project --> Clean" as cache flush?
    I did "Clean Project" (from the pop up window which comes when right clicking in the Project Explorer window) also sir. But it didn't re-write my IC.

    Why my Chip is getting locked?
    Please guide me sir.

    Thanks in advance.

    Regards,
    Karthikeyan.K
  • Hi Karthik,

      Please see below screenshot. Please go to Tools->ARM Advanced Features and you can click on the "Flush All Caches" button before you try to program/erase this particular troubled project, i.e. example_FreeRTOSBlinky. Normally, you should not need to flush the cache in order to program/erase. We have asked four flash loader developer to understand the issue. Please let me know if it works for you. I tried it on my side with the LC4357 HDK and it works for me.