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.
I have been trying to implement a bootloader using the bootloader provided for Hercules Microcontrollers https://git.ti.com/cgit/hercules_examples/hercules_examples/tree/Bootloaders?h=master. I am using TMS570LC4357 microcontroller. I am able to successfully bootload and run my application code using the given bootloader, and now as I am trying to implement a delay in the boot code before jumping to the application code, the RTI timer interrupt is not working. I have observed that the counter itself isn't working when I call the "_enable_IRQ_interrupt_()" function. When I don't call it, the counter is up and running but it does not trigger an interrupt. I have also observed that when I modify the "_enable_IRQ_interrupt_()" function as per the Technical Reference Manual of the controller as
"IRQENABLE .equ 0x80
FIQENABLE .equ 0x40
Enable_Irq
MRS R1, CPSR
BIC R1, R1, #IRQENABLE
MSR CPSR, R1
MOV PC, LR"
the specific statement causing the running of counter was "BIC R1,R1, #IRQENABLE"
The counter is running properly when I put an other value instead of #80 at the address of #IRQENABLE, similar thing is happening for FIQ, when I put the address other than #40. Please help me with working with interrupts properly. I am going to try generating an SCI interrupt and update you with the result. Please help me if I am doing anything incorrect.
I have also observed that when I make the changes you have mentioned in the exception vector table in the application report of CAN bootloader for Hercules Microcontrollers, I have observed that the counter is running properly but the interrupt is not being triggered. I think I am unable to figure out the usage of interrupt vector table of boot code and application code.
Thank You
Regards,
T. Sharath Chandra
Hi Sharath,
Have you enabled the RTI notification?
/* Enable RTI Compare 0 interrupt notification */
rtiEnableNotification(rtiREG1,rtiNOTIFICATION_COMPARE0);
/* Enable IRQ - Clear I flag in CPS register */
/* Note: This is usually done by the OS or in an svc dispatcher */
_enable_IRQ_interrupt_();
/* Start RTI Counter Block 0 */
rtiStartCounter(rtiREG1,rtiCOUNTER_BLOCK0);
and
Hello Mr. Wang, as mentioned in https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1095600/tms570lc4357-how-to-enable-rti-in-uart-bootloader removing memory copy of constant section is helping running the timer. I need to change the command file as given and test once. Thank you.