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
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:
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
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
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.
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.
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.
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
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
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.
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.
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:
2. The bootloader version can be updated using an external debugger connected to the OpenSDA's JTAG interface found at J16:
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
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
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.
There are two options to solve the issue:
Hope this helps,
Victor
After running above steps, i received error again with the PIL testing.
Caused by: Error(s) encountered while building "evkmimxrt1010_pil_target"
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.
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
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:-
Caused by: Error(s) encountered while building "evkmimxrt1010_pil_harness"
BR
Venkat
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
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