RA6M5 MCUBoot Linker Issue

Hello,

So I've been using the following examples:

https://www.renesas.cn/cn/zh/document/apn/booting-encrypted-image-using-mcuboot-and-qspi-application-project

https://www.renesas.com/us/en/document/apn/ra6-basic-secure-bootloader-using-mcuboot-and-internal-code-flash

to make a MCUBoot application. Everything compiles and runs fine until I try to include the boot_set_confirmed function. If I include a call to this function in my application code then I get a bunch of linker errors all related to gp_mcuboot_xspi_instance being undefined:

In my application configuration I have the MCUboot Image Utilities stack.

I have imported this following project as well and have gotten it to compile just fine after updating it to FSP 5.4, and I based my project off of it so I'm not sure what I'm doing wrong

https://en.na4.teamsupport.com/knowledgeBase/20773940

Thanks in advance for any help.

Parents Reply
  • Hi Nick.  When I upgraded FSP 5.5.0 I ran into this same issue.  I fixed it by adding these lines of code in hal_entry.c at the very top.

    qspi_instance_ctrl_t * const gp_mcuboot_qspi_ctrl = &g_qspi0_ctrl;

    spi_flash_cfg_t const * const gp_mcuboot_qspi_cfg = &g_qspi0_cfg;

    spi_flash_instance_t const * const gp_mcuboot_qspi_instance = &g_qspi0;

    And naming the QSPI instance g_qspi0 (or whatever it is name in the bootloader project)

    I attached a simple project that checks to see if it has already confirmed itself.

    And allows a user to confirm (or neglect to) for testing purposes.

    using --pad in the bootloader project.

    image_that_confirms_itself.zip

Children
  • Thank you, Dale, this solved the problem I was having. This must be a FSP 5.5 issue.

    I'm running ThreadX but was able to just add the following lines of code to the hal_entry.c file and everything seems to be working as intended now.

    qspi_instance_ctrl_t * const gp_mcuboot_qspi_ctrl = &g_qspi_ctrl;
    spi_flash_cfg_t const * const gp_mcuboot_qspi_cfg = &g_qspi_cfg;
    spi_flash_instance_t const * const gp_mcuboot_qspi_instance = &g_qspi;
    spi_flash_instance_t const * const gp_mcuboot_xspi_instance = gp_mcuboot_qspi_instance;
    
    /*******************************************************************************************************************//**
     * main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used.  This function
     * is called by main() when no RTOS is used.
     **********************************************************************************************************************/
    void hal_entry(void)
    {
        /* TODO: add your own code here */
    
    #if BSP_TZ_SECURE_BUILD
        /* Enter non-secure code */
        R_BSP_NonSecureEnter();
    #endif
    }