MIMXRT1170 Pending interrupts

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

MIMXRT1170 Pending interrupts

953 Views
GLantzTCore
Contributor III

I am trying to find a way to clear all pending interrupts in the MIMXRT1170.  I have code that erases and programs external spi flash (using the MIMXRT1170-EVK and IAR embedded workbench).  I disable interrupts before the code that erases sector by sector and programs each sector, and when the code completes, it enables interrupts and at that point the cpu resets.  If I have the IAR i-jet debugger connected and use it to load my application and without any breakpoints set I start the application, it runs perfectly (no reset).  When I change the dip switches to boot from the spi flash, the code resets upon interrupts being enabled.  Any help would be appreciated.

0 Kudos
Reply
3 Replies

915 Views
GLantzTCore
Contributor III

I am using the IAR Embedded Workbench as my tool base and this sets the named objects into a safe space to erase/program flash from.  The application I am running is located in SPI Flash as well, so I have addressed the issue of erasing/writing flash from memory.

initialize by copy {
readwrite,

/* Explicitly place flash operation functions in RAM. */
object mflash_drv.o,
object fsl_flexspi.o,
object fsl_cache.o,
object flexspi_nor_flash_ops.o,
object dlUtils.o,

section .textrw,
section CodeQuickAccess,
section DataQuickAccess
};

 

The data programmed into the flash is complete as verified by a CRC that emcompasses the entire data block being written.  So it is something that happens when I re-enable interrupts.

the code looks something like this:

asm("CPSID I"); //Mask interrupts

flexspi_nor_flash_init(SPIFLASH_BASE);

numSectors = (dataLen / SECTOR_SIZE);
if ((dataLen % SECTOR_SIZE) != 0)
numSectors++;

/* Enter quad mode. */
status = flexspi_nor_enable_quad_mode(SPIFLASH_BASE);

// erase all necessary sectors.
for (i = 32; i < numSectors+32; i++)
{
    status = flexspi_nor_flash_erase_sector(SPIFLASH_BASE, i * SECTOR_SIZE);
    if (status != kStatus_Success)
    {
        dlFlag = FALSE;
        return status; // Error erasing, abort
    }
    for (j = 0; j < PAGES_PER_SECTOR; j++)
    {
        status = flexspi_nor_flash_page_program(SPIFLASH_BASE,
                        (i * SECTOR_SIZE) + (j * FLASH_PAGE_SIZE),
                         (const uint32_t *)(srcAddr));
         srcAddr += FLASH_PAGE_SIZE;
         if (status != kStatus_Success)
        {
            dlFlag = FALSE;
             return status;
        }
    }
}

asm("CPSIE I"); //Unmask interrupts

0 Kudos
Reply

898 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi  @GLantzTCore ,

 

I did some test based on evkbmimxrt1170_flexspi_nor_polling_transfer_cm7 with interrupts disabled in the beginning and enabled in the end, the result is still ok. Please kindly refer to the following for details.

 

Kan_Li_0-1742539322136.png

Kan_Li_1-1742539407067.pngKan_Li_2-1742539421469.png

 

The board never resets here, but I am using MCUXpresso IDE instead, would you please try this IDE as well? 

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
Reply

926 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @GLantzTCore ,

 

Was your code running from the same memory space? Basically when we run code to erase/program the flexspi flash, such operation should be issued from another memory space , such as ITCM or SDRAM, please kindly refer to the SDK demo of evkbmimxrt1170_flexspi_nor_polling_transfer_cm7 for details.

Kan_Li_0-1742449226456.png

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
Reply