Problems migration mqx3.7 to mqx4.0

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

Problems migration mqx3.7 to mqx4.0

563 Views
feraro
Contributor IV

Hello.

I have a project created with MQX 3.7 and CW10.5  and working properly.

I'm trying to start a new project based on this, but with MQX 4.0.2
I have the following problem, when I try to erase the flash memory:

    error_code = _io_ioctl (flash_hdl, FLASH_IOCTL_ERASE_CHIP, NULL);

the program jumps to _int_kernel_isr


The complete code is:


   // Open the flash device

    flash_hdl = flash_open(FLASH_NAME);

    // Enable sector cache

   _io_ioctl(flash_hdl, FLASH_IOCTL_ENABLE_SECTOR_CACHE, NULL);

    _io_ioctl(flash_hdl, IO_IOCTL_DEVICE_IDENTIFY, &ident_arr[0]);

  

   // Get base address

   error_code = ioctl(flash_hdl, FLASH_IOCTL_GET_BASE_ADDRESS, &base_addr);

   error_code = ioctl(flash_hdl, FLASH_IOCTL_GET_BLOCK_MAP,(uint_32 _PTR_)&info_ptr);     

  

   // Erase all the flash

   error_code = _io_ioctl(flash_hdl, FLASH_IOCTL_ERASE_CHIP, NULL);

Someone can help me?.


Thank you very much.

0 Kudos
3 Replies

367 Views
DavidS
NXP Employee
NXP Employee

Hi Fernando,

Are you running the code from flash?  If yes you cannot erase the flash you are running out of.

Have you reviewed the MQX4.0.2\mqx\examples\flashx project?

I have not compared the MQX3.7 to MQX4.0.2.

I have verified that the MQX4/0/2\mqx\examples\flashx is working with TWR-K60N512,

Regards,

David

0 Kudos

367 Views
KJFPE
Contributor III

Hi Fernando,

Which chip are you using?

0 Kudos

367 Views
feraro
Contributor IV

Hi Kevin.

Is the internal flash MK60DN512 own.


Regards

0 Kudos