PSRAM boot

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
90670
Level 4
Level 4
25 replies posted 25 sign-ins 10 questions asked

Hi everyone, 

I want to use PSRAM boot mode for my bootloader project. Does anyone have PSRAM bootmode example? I don't know how to set up PSRAM header correctly.

0 Likes
2 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @90670,

Have you followed the steps given in the section 27.3.2 Boot from PSRAM of XMC4700 XMC4800 Reference Manual ? The header needs to be prepared in the following fashion:

ncbs_0-1666260836633.png

The magic key is 0xA5C3E10F and the polynomial used forchecksum calculation is 0x04C11DB7 with a initial value of 0x0 H.

Regards,
Nikhil

0 Likes
90670
Level 4
Level 4
25 replies posted 25 sign-ins 10 questions asked

the headerCRC32 is calculated by this function right?

typedef struct ABM_Header {
    uint32_t MagicKey; /**< Magic key. Always 0xA5C3E10F */
    uint32_t StartAddress; /**< Start address of the programm to load */
    uint32_t Length; /**< Length of the programm to load. */
    uint32_t ApplicationCRC32; /**< CRC32 Sum of the complete application code */
    uint32_t HeaderCRC32; /**< CRC32 Sum of the four fields before */
} ABM_Header_t;
 
uint32_t BL_CalculateHeaderCRC32(const ABM_Header_t * Header)
{
    SCU_RESET->PRCLR2 = SCU_RESET_PRCLR2_FCERS_Msk;
    while((SCU_RESET->PRSTAT2 & SCU_RESET_PRSTAT2_FCERS_Msk));
    FCE->CLC = 0;
    while((FCE->CLC & FCE_CLC_DISS_Msk));
    FCE_KE0->CFG = 0;
    FCE_KE0->CRC = 0;
    FCE_KE0->IR = *((uint32_t*)Header);
    FCE_KE0->IR = *((uint32_t*)(((void*)Header)+4));
    FCE_KE0->IR = *((uint32_t*)(((void*)Header)+8));
    FCE_KE0->IR = *((uint32_t*)(((void*)Header)+12));
    return FCE_KE0->RES;
}
0 Likes