PN7462 Secondary Bootloader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PN7462 Secondary Bootloader

2,492 Views
mukadder
Contributor III

Is there any possibility to write a SW bootloader ( via uart, i2c etc. ) on PN7462?

Or what is the proper way to remote update its firmware?

Regards.

Mukadder.

Tags (1)
5 Replies

1,693 Views
shiv_patil
Contributor II

Hello @mukadder@IvanRuiz & @m_sedlak.
I am using the MCU Expresso IDE for the development of PN7462 NFC.
I would like to know the detailed procedure for implementing the secondary bootloader application to the PN7462AU_ex_phExCcid example.
Will you please give me a reference related to it?

0 Kudos

1,951 Views
IvanRuiz
NXP Employee
NXP Employee

Hello,

Currently you could only refer to AN10995. The secondary Bootloader project described here is implemented with the M0 LPC and many concepts could be reused also in PN7462AU project.

Regards,

Ivan.

1,951 Views
mukadder
Contributor III

Hello,

Finally finished the development successfully. It uses HSU / VCOM with XMODEM protocol and also optionally uses NOR flash memory.

Regards

Mukadder

0 Kudos

1,951 Views
m_sedlak
Contributor I

Hi,

Could be please describe your procedure little bit more in detail? You've used re-directing vector table using the asm code provided in AN10995, modified linkerscripts (making another space for bootloader) generated for PN7462 example projects, and used phhalFlash for controlling internal flash memory? - this was procedure I was using for LPC11xx (with IAP procedure for controlling internal flash memory), but not sure if same approach should be used also here, since PN7462 has a lot of supporting functions. 

Many thanks for detailed description. 

Best Regards,

Milan

0 Kudos

1,951 Views
mukadder
Contributor III

Dear Milan,

Sorry to write late.

You can follow AN10995 but since there is no VTOR in this architecture you must re-map some vectors to the user space with a static variable which must be located at the bottom of the SRAM. I am not using IAR and implemented with Keil.

So; to start,

*  Reserve some additional bytes in SRAM ;

   //SRAM 1st 32 Byte is reserved: 0x100000 ... 0x100020 used by Vectors ( Reserved )
   //SRAM 2nd 32 Byte is reserved: 0x100020 ... 0x100040 by Sw Bootloader

* Use IRQ mapping ( for example if application starts at 0x20B000UL ) Your ( if used in bootloader ) IRQ handlers must like;

void SysTick_Handler(void )
{
    if( !irq_Handler_Get_Map() )
        sysTickHandler();       // Bootloader Side
    else
        app_SysTick_Handler();      // User Side
}

volatile int irqMap __attribute__((section(".ARM.__at_0x100020")));

int irq_Handler_Get_Map( void )
{
    return irqMap;
}

int irq_Handler_Set_Map( int map_Value )
{
    irqMap = map_Value;
    return irqMap;
}

* You can use the following Flash Memory Example;

int isp_Flash_WriteTest( void )
{
    int i;
    unsigned long flashOffsetAddr = 32*1024;
    unsigned long dwPageNumber;
    uint8_t *ReadAddress;
    phStatus_t flashStatus;
    
    //WRITE START HERE
    dwPageNumber = PHHAL_FLASH_USER_PAGE_START + flashOffsetAddr / PHHAL_FLASH_PAGE_SIZE;
    utilUartPrintf("Starting Flash-Write...Page: %d\n", dwPageNumber );
    
    isp_Flash_Init();
    
    for( i = 0; i<5; ++i )
    {
        memset( flashBuffer, 0xA0 + i, sizeof(flashBuffer) );
        flashStatus = phhalFlash_WritePage( dwPageNumber + i, flashBuffer );
    }
    
    //READ START HERE...
    ReadAddress = (unsigned char *) ( flashOffsetAddr + PHHAL_FLASH_USER_START_ADDRESS );
    utilUartPrintf("Starting Flash-Read...%d\n", ReadAddress );
    
    isp_Flash_Init();
    
    for( i = 0; i<5; ++i )
    {
        ReadAddress = (unsigned char *) ( flashOffsetAddr + PHHAL_FLASH_USER_START_ADDRESS + i * PHHAL_FLASH_PAGE_SIZE );
        flashStatus = phhalFlash_ReadBuffer( flashBuffer, ReadAddress, PHHAL_FLASH_PAGE_SIZE );
        
        debugPrintHexDump("Buffer", flashBuffer, PHHAL_FLASH_PAGE_SIZE );
    }
    
    return 1;    
}

Regards.