IMXRT1010XXX evaluation board programming issue with MATLAB

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

IMXRT1010XXX evaluation board programming issue with MATLAB

7,743 次查看
venkatm
Contributor II

Hello Community

I am using IMXRT1010XXX evaluation board and programmed using Matlab code generation, while flashing the program to the evaluation board it is always asking for rest, when I reset the board, then the programme is not flashing to the board, the same board when i flash using mcuExpresso IDE , it is working with out any issue, Can any one faced similar issue with MATLAB?

 

Best Regards

Venkat

0 项奖励
回复
23 回复数

7,093 次查看
georgevictor
NXP Employee
NXP Employee

Hi, @venkatm,

Thank you for using our Model-Based Design toolbox for i.MX.

I need additional information about your setup that might help me to identify your problem:

  1. What is the MATLAB version that you are using for your application?
  2.  Which i.MX toolbox version do you use?

Could you try to download an example delivered with our toolbox for the i.MX RT1010 like GPIO POLLING and validate the example using the guidance from the example readme.

Please let me know if you still experience the same problem with this particular example.

 

Best regards,

Victor

 

 

0 项奖励
回复

7,061 次查看
venkatm
Contributor II
the issue remains same
0 项奖励
回复

7,066 次查看
venkatm
Contributor II

I verified programming the board with matlab version 2021b and NXP_MBDToolbox_RT1 version 1.3.0, but the issue still remains with these also

0 项奖励
回复

7,053 次查看
georgevictor
NXP Employee
NXP Employee

Hi, @venkatm,

 

I tried to reproduce the issue on my side using the same MATLAB version, but everything works just fine for me.

Could you try to use the executable .axf file generated in Simulink by our example and download it onto the board using the mcuExpresso IDE? Let's see if it is a download problem or if the application is not running properly on the board. 

Cheers,

Victor

6,924 次查看
venkatm
Contributor II

While debugging with the MATLAB the main cause of the issue was related to a protected NXP toolbox file responsible for loading the executable onto the drive. To proceed with further debugging, it is crucial to obtain information regarding the contents of this protected file.

0 项奖励
回复

6,852 次查看
georgevictor
NXP Employee
NXP Employee

Hi, @venkatm,

 

Could you verify what is the download method configured in your Simulink example? 

By default, the examples delivered with our toolbox are set on OpenSDA.

georgevictor_0-1693843442299.png

 

In this case, you have to ensure a USB connection between the evaluation board's OpenSDA port and your computer. Using this method, our script copies the executable .bin file to the evaluation board's OpenSDA drive, in my case, drive (D:). 

You could also try to manually copy the .bin to the drive associated with your evaluation board. 

georgevictor_0-1693843960134.png

This way, we can determine if there is a problem with our download script or the OpenSDA's bootloader needs an update. 

Best regrads,

Victor

0 项奖励
回复

6,819 次查看
venkatm
Contributor II

I have selected openSDA with the required COM selection, The protected MATLAB script not copying the axf file to the virtual drive D in the PC and not downloading to the board.

Secondly, I tried manually coping the axf file into virtual drive giving following error:

error- File sent out of order by PC. Target might not be programmed correctly.
type: transient

 

0 项奖励
回复

6,770 次查看
georgevictor
NXP Employee
NXP Employee

Hi, @venkatm,

The next step that we will need to follow is to verify your current bootloader version on the I.MX RT1010 board. To do that, open the DETAILS.TXT file from the virtual drive associated with your board and check the Bootloader Version and Interface Version fields. 

georgevictor_0-1694070021456.png

My board has the latest versions for both the Bootloader Version (0244) and the Interface Version (0246).

The OpenSDA update procedure can be found on the following NXP page: OpenSDA Serial and Debug Adapter.

georgevictor_1-1694072557027.png

Here you can download the latest bootloader firmware (0244) and the latest application firmware (0244)

Tips for the update procedure:

1. To start your board in bootloader mode, you need to set the J27 jumper on 1-2 in order to send the reset signal to the OpenSDA chip. The following picture is from the I.MX RT1010 schematic:

georgevictor_0-1694073077352.png

2. The bootloader version can be updated using an external debugger connected to the OpenSDA's  JTAG interface found at J16:

georgevictor_1-1694073361755.png

3. The application firmware (Interface Version) can be updated by copying the .bin file onto the board's virtual drive when it is in bootloader mode.

Let me know if this helped.

 

Cheers,

Victor

 

0 项奖励
回复

6,763 次查看
venkatm
Contributor II

The details.txt file has latest boot loader and interface version.

# DAPLink Firmware - see https://mbed.com/daplink
Unique ID: 0227000012137e1600000000000000000000000097969905
HIC ID: 97969905
Auto Reset: 0
Automation allowed: 0
Overflow detection: 0
Daplink Mode: Interface
Interface Version: 0246
Bootloader Version: 0244
Git SHA: b965bacc9b93e23943b39e1b09cb4699468a3c49
Local Mods: 0
USB Interfaces: MSD, CDC, HID, WebUSB
Bootloader CRC: 0xe493996b
Interface CRC: 0xb3ff60f9
Remount count: 2

0 项奖励
回复

6,493 次查看
georgevictor
NXP Employee
NXP Employee

 

Hi, @venkatm ,

 

The evaluation board programming is performed successfully. The download process within our toolbox is followed by a pop-up window that informs the user to reset the board. This Simulink pop-up will not automatically go away after the reset button is pressed and may cause confusion.

 

The PiL and External Mode functionalities usage with the i.MX RT 1010 EVK require additional steps that need to be performed.

Our toolbox provides a default .mex configuration for i.MX RT1010 that is brought next to a model configured for this microcontroller. The OpenSDA chip uses the LPUART1 instance of the board for the serial communication. In the McuExpresso configuration, the LPUART1 settings has the RX FIFO watermark configuration that is set to 1. This means that the interrupt for data receive will occur only after the watermark value is reached. This setting causes a communication delay between the Simulink environment and the board and finally, a Simulink timeout error.   

georgevictor_0-1696261183580.png

 

There are two options to solve the issue:

  • replace the default .mex configuration for the i.MX 1010 MCU found in  mbdtbx_imxrt\devices\MIMXRT1011 with the attached one (mimxrt1011.mex). In this case, all new models set for this MCU will use the updated configuration file.
  • update the RX FIFO watermark configuration in your particular project by pressing the Configure button in one of our blocks to open McuExpresso.

 

Hope this helps,

Victor  

 

0 项奖励
回复

6,185 次查看
venkatm
Contributor II

After running above steps, i received error again with the PIL testing.

 
C:/Users/u221508/AppData/Roaming/MATHWO~1/MATLAB~1/TOOLBO~1/NXP_MB~3/IMXRT_~1/IMXRT1~1/IMXRT1~1/IMXRT1~1/pil/simple/evkmimxrt1010_pil_targetConfig/RTCESL/libMLIB.a C:/Users/u221508/AppData/Roaming/MATHWO~1/MATLAB~1/TOOLBO~1/NXP_MB~3/IMXRT_~1/IMXRT1~1/IMXRT1~1/IMXRT1~1/pil/simple/evkmimxrt1010_pil_target_ert_rtw/coderassumptions/lib/evkmimxrt1010_pil_target_ca.a Memory region Used Size Region Size %age Used BOARD_FLASH: 44584 B 16 MB 0.27% SRAM_DTC: 5284 B 32 KB 16.13% SRAM_ITC: 0 GB 32 KB 0.00% SRAM_OC: 0 GB 64 KB 0.00% NCACHE_REGION: 0 GB 0 GBc:/users/u221508/appdata/roaming/mathworks/matlab add-ons/toolboxes/nxp_mbdtoolbox_imxrt1xxx(2)/tools/buildtools/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: ../instrumented/imxrt_trigger_config.o: in function `SysTick_Handler': C:/Users/u221508/AppData/Roaming/MATHWO~1/MATLAB~1/TOOLBO~1/NXP_MB~3/IMXRT_~1/IMXRT1~1/IMXRT1~1/IMXRT1~1/pil/simple/evkmimxrt1010_pil_targetConfig/source/imxrt_trigger_config.c:54: undefined reference to `rt_OneStep' collect2.exe: error: ld returned 1 exit status gmake: *** [evkmimxrt1010_pil_target.axf] Error 1 C:\Users\u221508\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_IMXRT1xxx(2)\IMXRT_Examples\imxrt101x\imxrt101x_pil_extmode\imxrt101x\pil\simple\evkmimxrt1010_pil_target_ert_rtw\pil>echo The make command returned an error of 2 The make command returned an error of 2 C:\Users\u221508\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_IMXRT1xxx(2)\IMXRT_Examples\imxrt101x\imxrt101x_pil_extmode\imxrt101x\pil\simple\evkmimxrt1010_pil_target_ert_rtw\pil>exit /B 1
 
An error occurred while calling into the SIL or PIL target connectivity implementation.
 

Caused by: Error(s) encountered while building "evkmimxrt1010_pil_target"

Component:Simulink | Category:Model error

 

0 项奖励
回复

6,344 次查看
venkatm
Contributor II

Hello Victor

 

Could you please share RT1010X PIL model to test on the board, in my toolbox examples i could not find the IMXRT1010 PIL model examples.

 

BR

Venkat

0 项奖励
回复

6,246 次查看
georgevictor
NXP Employee
NXP Employee

Hi, @venkatm,

 

I have attached two examples that illustrate the PIL and External Mode functionalities for i.MX RT1010.

To run a PIL simulation, open the evkmimxrt1010_pil_harness model. In the SIL/PIL group, select Model blocks to get the referenced model, evkmimxrt1010_pil_target under test. Make sure that you have previously opened Hardware settings and selected the corresponding COM port in the PIL group for both the harness and target models in accordance with your hardware connection.  The OpenSDA download drive has to be selected to download the executable file onto the board. The default LPUART1 instance selected in the model is the same as the one in the configuration project, so there is no need to update it.

georgevictor_1-1697467525568.png

 

 

 

The logic of the examples is the same as that of the other hardware parts examples included in the toolbox. You can easily start from another example, update the Hardware Board in the model settings, and refresh the blocks' parameters within the model in accordance with the new configuration. 

Let me know if you have managed to successfully run the PiL simulation using your evaluation board.

 

Cheers,

Victor 

0 项奖励
回复

6,150 次查看
venkatm
Contributor II

Hello Victor,

 

I have tried running the given PIL with proper com port settings, LPUART1 and updated with given .mex file, still it showing the error.

Error:-

c:/users/u221508/appdata/roaming/mathworks/matlab add-ons/toolboxes/nxp_mbdtoolbox_imxrt1xxx(2)/tools/buildtools/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: error: linker script file 'MIMXRT1011xxxxx.ld' appears multiple times collect2.exe: error: ld returned 1 exit status gmake: *** [evkmimxrt1010_pil_harness.axf] Error 1 C:\Users\u221508\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_IMXRT1xxx(2)\evkmimxrt1010_pil_harness_ert_rtw\pil>echo The make command returned an error of 2 The make command returned an error of 2 C:\Users\u221508\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_IMXRT1xxx(2)\evkmimxrt1010_pil_harness_ert_rtw\pil>exit /B 1
An error occurred while calling into the SIL or PIL target connectivity implementation.

Caused by: Error(s) encountered while building "evkmimxrt1010_pil_harness"

Component:Simulink | Category:Model error
 

BR

Venkat

0 项奖励
回复

6,167 次查看
venkatm
Contributor II

 

I have to clarify few details, Will you send meeting request for tomorrow some time slot?

 

 

0 项奖励
回复

6,239 次查看
venkatm
Contributor II

Thank you. I have to run the model on the board, now i have to use those remotely from another city, now i am waiting someone to be in office for the board reset., it will take some time to run the models and will let you know if i face any issues after running the models

0 项奖励
回复

6,971 次查看
venkatm
Contributor II

I programmed MATLAB .axf file using IDE and It is working with IDE.

 

Executing flash operation 'Program' (Program file into flash: evkmimxrt1010_gpio_interrupt.axf) - Thu Aug 31 13:15:18 IST 2023

Checking MCU info...

Scanning for targets...

Executing flash action...

MCUXpresso IDE RedlinkMulti Driver v11.8 (Jul 12 2023 16:09:15 - crt_emu_cm_redlink.exe build 2)

( 0) Reading remote configuration

Wc(03). No cache support.

Found chip XML file in C:/Users/u221508/Documents/MCUXpressoIDE_11.8.0_1165/evkmimxrt1010_igpio_led_output/Debug\MIMXRT1011xxxxx.xml

( 5) Remote configuration complete

Reconnected to existing LinkServer process.

============= SCRIPT: RT1010_connect.scp =============

RT1010 Connect Script

DpID = 0BD11477

APID = 0x04770041

Wirespeed = 10000000 Hz

Resetting and trapping

Back from reset

Disabling MPU

Configure FlexRAM for 64KB OC RAM, 32KB I-TCM, 32KB D-TCM

Finished

============= END SCRIPT =============================

Probe Firmware: CMSIS-DAP (ARM)

Serial Number: 02270000076deb2800000000000000000000000097969905

VID:PID: 0D28:0204

USB Path: \\?\hid#vid_0d28&pid_0204&mi_03#7&1345d5c4&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}

Using memory from core 0 after searching for a good core

( 30) Emulator Connected

warning - watchpoint hit but none found set

( 40) Debug Halt

( 50) CPU ID

debug interface type = CoreSight DP (DAP DP ID 0BD11477) over SWD TAP 0

processor type = Cortex-M7 (CPU ID 00000C27) on DAP AP 0

number of h/w breakpoints = 8

number of flash patches = 0

number of h/w watchpoints = 4

Probe(0): Connected&Reset. DpID: 0BD11477. CpuID: 00000C27. Info: <None>

Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.

Content of CoreSight Debug ROM(s):

RBASE E00FD000: CID B105100D PID 000008E88C ROM (type 0x1)

ROM 1 E00FE000: CID B105100D PID 04000BB4C8 ROM (type 0x1)

ROM 2 E00FF000: CID B105100D PID 04000BB4C7 ROM (type 0x1)

ROM 3 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)

ROM 3 E0001000: CID B105E00D PID 04000BB002 Gen DWT (type 0x0)

ROM 3 E0002000: CID B105E00D PID 04000BB00E Gen (type 0x0)

ROM 3 E0000000: CID B105E00D PID 04000BB001 Gen ITM (type 0x0)

ROM 2 E0041000: CID B105900D PID 04001BB975 CSt ARM ETMv4.0 type 0x13 Trace Source - Core

ROM 2 E0042000: CID B105900D PID 04004BB906 CSt type 0x14 Debug Control - Trigger, e.g. ECT

ROM 1 E0040000: CID B105900D PID 04000BB9A9 CSt type 0x11 Trace Sink - TPIU

ROM 1 E0043000: CID B105F00D PID 04001BB101 Sys (type 0x0)

NXP: MIMXRT1011xxxxx

DAP stride is 1024 bytes (256 words)

Inspected v.2 External Flash Device on SPI using SFDP JEDEC ID MIMXRT1010_SFDP_QSPI.cfx

Image 'iMXRT1010_SFDP_QSPI Jul 25 2023 09:10:38'

Opening flash driver MIMXRT1010_SFDP_QSPI.cfx

Sending VECTRESET to run flash driver

Flash variant 'JEDEC_SFDP_Device' detected (16MB = 256*64K at 0x60000000)

Closing flash driver MIMXRT1010_SFDP_QSPI.cfx

( 65) Chip Setup Complete

Connected: was_reset=true. was_stopped=true

( 70) License Check Complete

Loading 'evkmimxrt1010_gpio_interrupt.axf' ELF 0x60000000 len 0x971C

Opening flash driver MIMXRT1010_SFDP_QSPI.cfx (already resident)

Sending VECTRESET to run flash driver

Flash variant 'JEDEC_SFDP_Device' detected (16MB = 256*64K at 0x60000000)

Writing 38684 bytes to address 0x60000000 in Flash

1 of 1 ( 0) Writing sectors 0-0 at 0x60000000 with 38684 bytes

( 0) at 60000000: 0 bytes - 0/38684

( 42) at 60000000: 16384 bytes - 16384/38684

( 84) at 60004000: 16384 bytes - 32768/38684

(100) at 60008000: 16384 bytes - 49152/38684

Sectors written: 1, unchanged: 0, total: 1

Erased/Wrote sector 0-0 with 38684 bytes in 2370msec

Closing flash driver MIMXRT1010_SFDP_QSPI.cfx

(100) Finished writing Flash successfully.

Flash Write Done

Loaded 0x971C bytes in 2679ms (about 14kB/s)

Reset target (system)

Starting execution using system reset

 

标记 (1)
0 项奖励
回复

6,962 次查看
venkatm
Contributor II
the issue with the matlab is remain same
0 项奖励
回复

6,983 次查看
venkatm
Contributor II

i tried flashing the .axf file, it does not working

0 项奖励
回复

7,022 次查看
venkatm
Contributor II
I will try that and let you know
0 项奖励
回复