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.

RM57L843: UART_Bootlader_RM57 Questions

Part Number: RM57L843

UART_Bootlader_RM57.zip

Hi, TI team
I am creating a Serial Bootloader on a custom board using RM57x MPU, and I am asking because my application program is not working.


The Bootloader Sample I used is shown below.
The files below are taken from the TI forums.


Hercules_Ethernet_Bootloader_RM57.zip
UART_Bootloader_LC4357_New.zip


I deleted the Ethernet part of Hercules_Ethernet_Bootloader_RM57.
Combine the Serial processing part of UART_Bootloader_LC4357_New to create a Serial bootloader for RM57.


I attach the UART_Bootlader_RM57.zip serial bootloader file I created.


The bootloader was programmed through JTAG, and the application program was programmed through the bootloader.
The way to run the Application program in the bootloader is to make the Appliaction run if there is no input from the serial port when the bootloader is running.


After booting, the application I created does not work because it outputs messages through the serial console but does not receive input from the serial console.


The execution result is shown below.


Program Version = 100
spiWrEnable
Memory size : 1M bit
=================================
MAIN Start
=================================


Start init ETH no= 0
MR value is 0000(MR=60020001)
E-init 0
add MTYPER = 0x60020030
add MTYPER1 = 0x60020031
E-init 1
E-init 2
E-init 3
mac : 00:00:00:00:00:00:00:00
GWR : 0.0.0.0
subr : 0.0.0.0
IP : 0.0.0.0
Ethernet source port = 5000
Ethernet dest port = 7000
End of ETH init
<--- If there is a serial input, the following behavior should be performed, but it is not performed.


The part of the application that waits for serial input is input by using the sciEnableNotification(sciREG1, SCI_RX_INT); function.


However, when I programmed the Appliaction program with JTAG to use the bootloader, it worked fine.


The execution result is shown below.


Program Version = 100
spiWrEnable
Memory size : 1M bit
=================================
MAIN Start
=================================


Start init ETH no= 0
MR value is 0000(MR=60020001)
E-init 0
add MTYPER = 0x60020030
add MTYPER1 = 0x60020031
E-init 1
E-init 2
E-init 3
MAC : 00:0e:36:ff:ff:50
gwr : 192.168.0.1
subr : 255.255.255.0
IP : 192.168.0.60
Ethernet source port = 5000
Ethernet dest port = 7000
End of ETH init
<----- When entering serial data, the following message is displayed and normal operation is performed.


SCPU Menu
================================


1. Toggle RN LED
2. Toggle ER LED
6. Display IO Comm
7. Enable Power Check
8. Power off my channel power
9. Power off other channel power
s. sdram test


Is there any error related to interrupt or other vector table?
Can you tell me which part I should check?

  • Hi WonBin

    Hercules_Ethernet_Bootloader_RM57.zip
    UART_Bootloader_LC4357_New.zip


    I deleted the Ethernet part of Hercules_Ethernet_Bootloader_RM57.
    Combine the Serial processing part of UART_Bootloader_LC4357_New to create a Serial bootloader for RM57.

    I don't understand this, 

    If you want to use serial bootloader then why you need to take the Ethernet bootloader and combine UART bootloader with Ethernet bootloader instead of you can directly use the UART bootloader right?

    I would also like to suggest you refer below FAQ:
    (+) [FAQ] TMS570LC4357: Step by step procedure to execute UART Bootloader on TMS570LC4357 - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Here i gave the codes for UART bootloader and one example application (LED blinky). And i gave the step-by-step procedure to send the application binary to the bootloader over serial UART.

    --
    Thanks & regards,
    Jagadish.

  • Hi, jagadish.


    I want to use Serial or Ethernet as per my choice with one bootload.
    Could you please review the UART_Bootlader_RM57.zip file I created to see if there are any issues?

    Best Regards,

    WBLee

  • Hi, jagadish.

    I made a mistake in my previous communication.
    I don't need Ethernet, I only want to use Serial.

    I had to modify the UART_Bootloader_LC4357_New code because the endian mode is not the same as RM57Lx, and the CPU is different.
    And with the modified bootloader, the launchpad sample code I modified (gpio part) works fine.

    However, the application code I need to use is behaving abnormally, which is why I asked for help.

    I think it's a configuration error in the part related to the vector using interrupts in the application.

    Please help me.

    Best Regards,

    WBLee

  • Hi WonBin,

    However, the application code I need to use is behaving abnormally, which is why I asked for help.

    I think it's a configuration error in the part related to the vector using interrupts in the application.

    I am suspecting one thing as root cause!

    Actually, in application code startup file also (like bootloader) we will read the reset cause and based on that we will execute the initialization functions

    You can see that if the RESET cause equal to the POWERON_RESET, DEBUG_RESET or DEBUG_RESET then only we are executing the functions like "systemInit" and "vimInit".

    But here the problem is this, actually before application reading this reset cause first bootloader will read the reset cause right? What this bootloader will do is after reading the reset cause, it will erase the reset cause.

    So due to this when next time application reads the reset cause it will read the "NO_RESET" instead of actual RESET.

    And this will skip all the initializations("systemInit" and "vimInit") related to the application and code will directly enter into the default state and exit from there.

    Because of this your application code interrupts will not work and also pin configurations etc in application will not work.

    So, my suggestion would be this, add all the initialization functions in application code to the " USER CODE BEGIN (22) " like as shown below.

    Now our initialization functions will work irrespective of the RESET cause.

    --
    Thanks & regards,
    Jagadish.

  • Hi, jagadish.

    This was resolved by doing reset in the application.
    Thank you very much for your help.

    Best Regards,

    WBLee

  • Hi WB

    I also have a problem in running my application after jumping from bootloader. Can you let me know where you do the reset in your application? I assume the application is not the bootloader but the application you flashed using bootloader. Looking forward to your reply. Thank you for any help rendered.

  • Hi LayEng,
    I'm not an engineer, so it's hard for me to answer.
    My boss is an engineer.

    Here are my boss's comments for your reference.
    The problem was caused by the application program not going through the reset process when it runs.
    I assumed that the bootloader went through the reset process, so I let the application skip it.
    The problem was solved by performing a force reset during the initialization process in the application.

    Best Regards,

    WBLee

  • Hi WB

    Thank you for your reply. Hope you can help me to ask your boss. How does he force a reset. If the instruction is always present in the initialisation, there will be an endless reset when only one reset is required. I suppose the instruction he use for reset is below?

    sl_systemREG1->SYSECR = ((uint32)0x2u << 14u);

    Thank you for your help

  • Hi LayEng,

    My boss's answer is shown below.

    If your question is about how to run an application after writing it to Flash in the Bootloader, the answer is as follows.

    After writing the application to Flash, jump to the application start address and run it.

    #define APP_START_ADDRESS 0x00020020
    uint32_t g_ulTransferAddress;

    g_ulTransferAddress = (uint32_t)APP_START_ADDRESS;
    ((void (*)(void))g_ulTransferAddress)();

    Best Regards,

    WBLee

  • Dear WB

    Thank you for your great help. I wasn't referring to "run an application after writing it to Flash in the Bootloader, " I know that. My problem is after jumping to the application using 
    g_ulTransferAddress = (uint32_t)APP_START_ADDRESS;
    ((void (*)(void))g_ulTransferAddress)();

    The application would not run. Your boss say that there is a need to do a reset in the application (meaning the application running from  g_ulTransferAddress)

    I am asking how to do it without it happening repetitively. Unless I misunderstand your boss. Your boss say "The problem was caused by the application program not going through the reset process when it runs.
    I assumed that the bootloader went through the reset process, so I let the application skip it.
    The problem was solved by performing a force reset during the initialization process in the application."

    So I think he mean this:

    bootloader app start from 0x00

    .....

    go to jump address of application

    g_ulTransferAddress = (uint32_t)APP_START_ADDRESS; 
    ((void (*)(void))g_ulTransferAddress)(); // jump to application

    APP_START_ADDRESS: 

    Initialisation functions;

    program comes here and there is a sw reset instruction here?

    Is that what you mean by "performing a force reset during the initialization process in the application"

    If yes, wouldn't it repeat always? How to let it do a reset once only?

    Hope I understand you correctly. Looking forward to your reply