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.
Hello,
We are using the Hercules RM48l952zwt. with 5.2.12 TI bootloader for the RM 48 and 4.3.00 HalCoGen. Uploaded the TI Bootloader and HalCoGen Genereated Drivers below. What is the difference Between Flash Initialization Driver in TI Bootloader and HalCoGen Generated Implementation for the Flash initialization? The reason is the HalCoGen generated code is very stable even if the AC fluctuates, but the TI bootloader version corrupts flash on initialization. What do we need to make identical in the TI bootloader like the HalCoGen code, to avaoid flash corruption on initialization? Thank You.
Hi QJ, We reversed engineered and did a diff between the HalCoGen init code and the bootloader init code. Some of the differences included:
1.In function _c_int00:
1.1 _coreInitRegisters_(); #31 not initialized in halcogen version and #19 not initialized in bootloader version
1.2 _coreInitStackPointer_(); ** different in both versions, #31 and memory alloc
1.3 _coreEnableEventBusExport_(); missing in bootloader version
1.4 _coreEnableFlashEcc_(); missing in bootloader version
1.5 _errata_CORTEXR4_66_(); missing in bootloader version but there is no source code to copy, what library is it in?
1.6 _errata_CORTEXR4_57_(); missing in bootloader version but there is no source code to copy, what library is it in?
1.7 not in bootloader version. if ((esmREG->SR1[2]) != 0U) { for(;;) { }/* Wait */
2.In function systemInit, muxInit is missing from the bootloader version
3. In function setupPll: systemREG1->PLLCTL1 set differently = 0x00000000U | 0x20000000U | ((0x1F)<< 24U) | 0x00000000U | ((6U - 1U)<< 16U) | ((120U - 1U)<< 8U); / /** set to 150U in HalCoGen version
4. In function setupFlash: flashWREG->FBFALLBACK is set differently. In bootloader version = 0x00000000 | (SYS_ACTIVE << 14U) | (SYS_SLEEP << 12U) | (SYS_SLEEP << 10U) | (SYS_SLEEP << 8U)
| (SYS_SLEEP<< 6U) | (SYS_SLEEP << 4U) | (SYS_ACTIVE<< 2U) | SYS_ACTIVE;
in HalCoGen version = 0x00000000U | (uint32)((uint32)SYS_ACTIVE << 14U) /* BANK 7 */ | (uint32)((uint32)SYS_ACTIVE << 2U) /* BANK 1 */ | (uint32)((uint32)SYS_ACTIVE << 0U); /* BANK 0 */
5. In function trimPLO: bootloader version set differently systemREG1->LPOMONCTL = (1U << 24U) | (16U << 8U) | 8U; //halcogen version it is set to 16U
6. In function mapClocks:
6.1 systemREG1->CDDIS set differently in bootloader version = (FALSE << 4 ) /* AVCLK 1 OFF */ |(TRUE << 5 ) /* AVCLK 2 OFF */ |(FALSE << 8 ) /* VCLK3 OFF */ |(FALSE << 10) /* AVCLK 3 OFF */ |(FALSE << 11); /* AVCLK 4 OFF */
in HalCoGen version = (uint32)((uint32)0U << 4U ) /* AVCLK 1 OFF */ | (uint32)((uint32)1U << 5U ) /* AVCLK 2 OFF */ | (uint32)((uint32)0U << 8U ) /* VCLK3 OFF */ | (uint32)((uint32)0U << 9U ) /* VCLK4 OFF */
| (uint32)((uint32)0U << 10U) /* AVCLK 3 OFF */ | (uint32)((uint32)0U << 11U); /* AVCLK 4 OFF */
6.2 setting systemREG1->PLLCTL2 and systemREG1->CLKCNTL missing in bootloader code but set in HalCoGen code
6.3 systemREG2->VCLKACON1 set differently. in bootloader version = (1U << 24) | 1 << 20U | (SYS_VCLK << 16) | (1U << 8) | 1 << 4U
in HalCoGen version = (uint32)((uint32)(1U - 1U) << 24U) | (uint32)((uint32)0U << 20U) | (uint32)((uint32)SYS_VCLK << 16U) | (uint32)((uint32)(4U - 1U) << 8U) | (uint32)((uint32)0U << 4U) | (uint32)((uint32)SYS_PLL2 << 0U);
7. In bootloader version F021 API libs are different version (2.1.00, Cortex R4BE and LE libs) then HalCoGen integrated version (only Cortex R4 LE V3D16)
Can we safely change the bootloader code to make it the same as HalCoGen generated code? For the errata code we do not have, where can we get the the libs? Can we safely replace the F021 lib from the HalCoGen version to the bootloader version? Thank You Again.