Hyperflash non blocking transfer causing instruction access violation

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

Hyperflash non blocking transfer causing instruction access violation

Jump to solution
1,335 Views
Abstractsig
Contributor I

I am testing the imxrt1050evbk with the flexspi hyper flash polling transfer example.

I have modified the function flexspi_nor_flash_erase_sector() to use FLEXSPI_TransferNonBlocking() instead of FLEXSPI_TransferBlocking() as shown below.

When I do this I get an instruction access violation when execution returns from the FLEXSPI_TransferNonBlocking() call.  However if I put a debug breakpoint after this call and manually continue each loop I do not get the fault.

Any hints on what might be causing this or suggestions on how I might further debug my example would be appreciated.

Thanks

 

 

 

 


volatile bool ___done;

void
flexspi_transfer_callback_1 (FLEXSPI_Type *base,flexspi_handle_t *handle,status_t status,void *userData) {
___done = true;
}

flexspi_handle_t es_handle;

status_t flexspi_nor_flash_erase_sector_nb (FLEXSPI_Type *base, uint32_t address)
{
status_t status;
flexspi_transfer_t flashXfer;

/* Write enable */
status = flexspi_nor_write_enable(base, address);

if (status != kStatus_Success)
{
return status;
}

flashXfer.deviceAddress = address;
flashXfer.port = kFLEXSPI_PortA1;
flashXfer.cmdType = kFLEXSPI_Command;
flashXfer.SeqNumber = 4;
flashXfer.seqIndex = HYPERFLASH_CMD_LUT_SEQ_IDX_ERASESECTOR;

FLEXSPI_TransferCreateHandle(base,&es_handle,flexspi_transfer_callback_1,NULL);

___done = false;
FLEXSPI_TransferNonBlocking (base,&es_handle,&flashXfer);

size_t count;

while ( FLEXSPI_TransferGetCount (base,&es_handle,&count) != kStatus_NoTransferInProgress);

/* Do software reset. */
FLEXSPI_SoftwareReset(EXAMPLE_FLEXSPI);

return status;
}

 

 

 

Labels (1)
0 Kudos
Reply
1 Solution
1,329 Views
Abstractsig
Contributor I

In answer to my own question.

It seems the fault occurs because the example puts the interrupt vector table in flash.

Moving the vector table to ram stops the access violation fault.

 

 

 

View solution in original post

2 Replies
121 Views
RajPadmani
Contributor I
Hi,
I am working on km34 for the flash read/write operation while continuous interrupts of ADC and timer (1 ms) but it shows it goes into hardflaut error, so i move my vector table to ram but still not able to flash operation and code continuous reset.

0 Kudos
Reply
1,330 Views
Abstractsig
Contributor I

In answer to my own question.

It seems the fault occurs because the example puts the interrupt vector table in flash.

Moving the vector table to ram stops the access violation fault.