Hyperflash non blocking transfer causing instruction access violation

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Hyperflash non blocking transfer causing instruction access violation

跳至解决方案
2,118 次查看
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;
}

 

 

 

标签 (1)
0 项奖励
回复
1 解答
2,112 次查看
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.

 

 

 

在原帖中查看解决方案

2 回复数
904 次查看
RajPadmani
Contributor II
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 项奖励
回复
2,113 次查看
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.