zephyr icon indicating copy to clipboard operation
zephyr copied to clipboard

Add RT700 basic environment support

Open lucien-nxp opened this issue 1 year ago • 6 comments

support gpio/uart function

lucien-nxp avatar Oct 03 '24 15:10 lucien-nxp

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp https://github.com/zephyrproject-rtos/hal_nxp/commit/b5f6470ec7ccd7f1c9a2c929fa93eae9fb001d9e https://github.com/zephyrproject-rtos/hal_nxp/commit/b4e6f883719387cbbf6e73346a553bf1b79e77b0 (master) zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

zephyrbot avatar Oct 03 '24 15:10 zephyrbot

@hakehuang , sorry I forget to remind you help test. Could you help test basic cases on RT700 board? I will update some content according to the comment above later.

lucien-nxp avatar Oct 10 '24 06:10 lucien-nxp

@lucien-nxp I meet below problem when flash the image to mimrt700_evk with linkserver see below, it reports Ed:05: File 'zephyr.bin' load failure: Eg(10). Attempt to load into missing flash area.

ubuntu@zephyr-test-06:~/zephyrproject/zephyr$ /usr/local/LinkServer/LinkServer flash --probe QMZ2QFRFA5ZVX -o /device/memory/1/flash-driver=MIMXRT700_XSPI0_Octal.cfx -o /device/memory/1/location=0x38000000 MIMXRT798S:MIMXRT700-EVK load --addr 939524096 /home/ubuntu/zephyrproject/zephyr/twister-out/mimxrt700_evk_mimxrt798s_cpu0/samples/hello_world/sample.basic.helloworld/zephyr/zephyr.bin
INFO: Exact match for MIMXRT798S:MIMXRT700-EVK found
INFO: Selected device MIMXRT798S:MIMXRT700-EVK
INFO: Getting available probes
INFO: Selecting probe by serial substring
INFO: Selected probe #1 QMZ2QFRFA5ZVX (MCU-LINK on-board (r1E6) CMSIS-DAP V3.148)
INFO: MCU-Link firmware update `check`: local firmware [3.148] is the same as the version running on the selected probe ([QMZ2QFRFA5ZVX] [MCU-LINK on-board (r1E6) CMSIS-DAP V3.148])
Firmware update `check`: not required - the update can be performed using `forced` mode
Ns: MCUXpresso IDE RedlinkMulti Driver v24.9 (Sep 19 2024 19:39:44 - crt_emu_cm_redlink build 802)
Pc: (  0) Reading remote configuration
Nc: Found generic directory XML file in /tmp/tmpui7pwq5f/crt_directory.xml
Pc: (  5) Remote configuration complete
Nc: Reconnected to existing LinkServer process.
Wc: ============= SCRIPT: RT700_connect.scp =============
Wc: RT700 Connect Script
Wc: ============= END SCRIPT ============================
Nc: Probe Firmware: MCU-LINK on-board (r1E6) CMSIS-DAP V3.148 (NXP Semiconductors)
Nc: Serial Number:  QMZ2QFRFA5ZVX
Nc: VID:PID:  1FC9:0143
Nc: USB Path: 0001:0002:00
Nc: Using memory from core 0 after searching for a good core
Pc: ( 30) Emulator Connected
Nc: processor is in secure mode
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: debug interface type      = CoreSight DP (DAP DP ID 6BA02477) over SWD TAP 0
Nc: processor type            = Cortex-M33 (CPU ID 00000D21) on DAP AP 0
Nc: number of h/w breakpoints = 8
Nc: number of flash patches   = 0
Nc: number of h/w watchpoints = 4
Nc: Probe(0): Connected&Reset. DpID: 6BA02477. CpuID: 00000D21. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Ns: Content of CoreSight Debug ROM(s):
Nc: RBASE E00FF000: CID B105100D PID 04000BB4C9 ROM (type 0x1)
Nc: ROM 1 E000E000: CID B105900D PID 04000BBD21 CSt ARM ARMv8-M type 0x0 Misc - Undefined
Nc: ROM 1 E0001000: CID B105900D PID 04000BBD21 CSt ARM DWTv2 type 0x0 Misc - Undefined
Nc: ROM 1 E0002000: CID B105900D PID 04000BBD21 CSt ARM FPBv2 type 0x0 Misc - Undefined
Nc: ROM 1 E0000000: CID B105900D PID 04000BBD21 CSt ARM ITMv2 type 0x43 Trace Source - Bus
Nc: ROM 1 E0041000: CID B105900D PID 04002BBD21 CSt ARM ETMv4.0 type 0x13 Trace Source - Core
Nc: ROM 1 E0042000: CID B105900D PID 04000BBD21 CSt ARM CTIv2 type 0x14 Debug Control - Trigger, e.g. ECT
Nc: CM33 Rev. 1.0  XCACHE
Nc: NXP: MIMXRT798S
Nc: DAP stride is 1024 bytes (256 words)
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI0_Octal.cfx
Nc: Image 'iMXRT700_XSPI0_Octal Flash Sep 19 2024 18:21:55'
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI0_Octal.cfx
Nc: Image 'iMXRT700_XSPI0_Octal Flash Sep 19 2024 18:21:55'
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI0_Octal_S.cfx
Nc: Image 'iMXRT700_XSPI0_Octal Flash Sep 19 2024 18:21:46'
Wc: flash cache - new flash area 'memoryInstance_5' overlaps existing flash area 'memoryInstance_1' - ignored
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI1_Octal.cfx
Nc: Image 'iMXRT700_XSPI1_Octal Flash Sep 19 2024 18:22:05'
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI1_Octal_S.cfx
Nc: Image 'iMXRT700_XSPI1_Octal Flash Sep 19 2024 18:21:21'
Pc: ( 65) Chip Setup Complete
Pc: ( 70) License Check Complete
Nt: Loading 'zephyr.bin' Binary 0x38000000 len 0xA1F2
Nc: Opening flash driver MIMXRT700_XSPI0_Octal.cfx
Nc: VECTRESET requested, but not supported on ARMv8-M CPUs. Using SOFTRESET instead.
Nc: Using SOFT reset to run the flash driver
Nc: Flash device supported (64MB = 16384*4K at 0x28000000)
Nc: Closing flash driver MIMXRT700_XSPI0_Octal.cfx
Pb: (100) Writing Flash ended with an error.
Ed:05: File 'zephyr.bin' load failure: Eg(10). Attempt to load into missing flash area.
Pc: (100) Target Operation Failed
CRITICAL: Critical error
ERRMSG: Exception: Flash operation exited with code 1

hakehuang avatar Oct 11 '24 03:10 hakehuang

@lucien-nxp I meet below problem when flash the image to mimrt700_evk with linkserver see below, it reports Ed:05: File 'zephyr.bin' load failure: Eg(10). Attempt to load into missing flash area.

ubuntu@zephyr-test-06:~/zephyrproject/zephyr$ /usr/local/LinkServer/LinkServer flash --probe QMZ2QFRFA5ZVX -o /device/memory/1/flash-driver=MIMXRT700_XSPI0_Octal.cfx -o /device/memory/1/location=0x38000000 MIMXRT798S:MIMXRT700-EVK load --addr 939524096 /home/ubuntu/zephyrproject/zephyr/twister-out/mimxrt700_evk_mimxrt798s_cpu0/samples/hello_world/sample.basic.helloworld/zephyr/zephyr.bin
INFO: Exact match for MIMXRT798S:MIMXRT700-EVK found
INFO: Selected device MIMXRT798S:MIMXRT700-EVK
INFO: Getting available probes
INFO: Selecting probe by serial substring
INFO: Selected probe #1 QMZ2QFRFA5ZVX (MCU-LINK on-board (r1E6) CMSIS-DAP V3.148)
INFO: MCU-Link firmware update `check`: local firmware [3.148] is the same as the version running on the selected probe ([QMZ2QFRFA5ZVX] [MCU-LINK on-board (r1E6) CMSIS-DAP V3.148])
Firmware update `check`: not required - the update can be performed using `forced` mode
Ns: MCUXpresso IDE RedlinkMulti Driver v24.9 (Sep 19 2024 19:39:44 - crt_emu_cm_redlink build 802)
Pc: (  0) Reading remote configuration
Nc: Found generic directory XML file in /tmp/tmpui7pwq5f/crt_directory.xml
Pc: (  5) Remote configuration complete
Nc: Reconnected to existing LinkServer process.
Wc: ============= SCRIPT: RT700_connect.scp =============
Wc: RT700 Connect Script
Wc: ============= END SCRIPT ============================
Nc: Probe Firmware: MCU-LINK on-board (r1E6) CMSIS-DAP V3.148 (NXP Semiconductors)
Nc: Serial Number:  QMZ2QFRFA5ZVX
Nc: VID:PID:  1FC9:0143
Nc: USB Path: 0001:0002:00
Nc: Using memory from core 0 after searching for a good core
Pc: ( 30) Emulator Connected
Nc: processor is in secure mode
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: debug interface type      = CoreSight DP (DAP DP ID 6BA02477) over SWD TAP 0
Nc: processor type            = Cortex-M33 (CPU ID 00000D21) on DAP AP 0
Nc: number of h/w breakpoints = 8
Nc: number of flash patches   = 0
Nc: number of h/w watchpoints = 4
Nc: Probe(0): Connected&Reset. DpID: 6BA02477. CpuID: 00000D21. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Ns: Content of CoreSight Debug ROM(s):
Nc: RBASE E00FF000: CID B105100D PID 04000BB4C9 ROM (type 0x1)
Nc: ROM 1 E000E000: CID B105900D PID 04000BBD21 CSt ARM ARMv8-M type 0x0 Misc - Undefined
Nc: ROM 1 E0001000: CID B105900D PID 04000BBD21 CSt ARM DWTv2 type 0x0 Misc - Undefined
Nc: ROM 1 E0002000: CID B105900D PID 04000BBD21 CSt ARM FPBv2 type 0x0 Misc - Undefined
Nc: ROM 1 E0000000: CID B105900D PID 04000BBD21 CSt ARM ITMv2 type 0x43 Trace Source - Bus
Nc: ROM 1 E0041000: CID B105900D PID 04002BBD21 CSt ARM ETMv4.0 type 0x13 Trace Source - Core
Nc: ROM 1 E0042000: CID B105900D PID 04000BBD21 CSt ARM CTIv2 type 0x14 Debug Control - Trigger, e.g. ECT
Nc: CM33 Rev. 1.0  XCACHE
Nc: NXP: MIMXRT798S
Nc: DAP stride is 1024 bytes (256 words)
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI0_Octal.cfx
Nc: Image 'iMXRT700_XSPI0_Octal Flash Sep 19 2024 18:21:55'
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI0_Octal.cfx
Nc: Image 'iMXRT700_XSPI0_Octal Flash Sep 19 2024 18:21:55'
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI0_Octal_S.cfx
Nc: Image 'iMXRT700_XSPI0_Octal Flash Sep 19 2024 18:21:46'
Wc: flash cache - new flash area 'memoryInstance_5' overlaps existing flash area 'memoryInstance_1' - ignored
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI1_Octal.cfx
Nc: Image 'iMXRT700_XSPI1_Octal Flash Sep 19 2024 18:22:05'
Nc: Inspected v.2 External Flash Device on SPI MIMXRT700_XSPI1_Octal_S.cfx
Nc: Image 'iMXRT700_XSPI1_Octal Flash Sep 19 2024 18:21:21'
Pc: ( 65) Chip Setup Complete
Pc: ( 70) License Check Complete
Nt: Loading 'zephyr.bin' Binary 0x38000000 len 0xA1F2
Nc: Opening flash driver MIMXRT700_XSPI0_Octal.cfx
Nc: VECTRESET requested, but not supported on ARMv8-M CPUs. Using SOFTRESET instead.
Nc: Using SOFT reset to run the flash driver
Nc: Flash device supported (64MB = 16384*4K at 0x28000000)
Nc: Closing flash driver MIMXRT700_XSPI0_Octal.cfx
Pb: (100) Writing Flash ended with an error.
Ed:05: File 'zephyr.bin' load failure: Eg(10). Attempt to load into missing flash area.
Pc: (100) Target Operation Failed
CRITICAL: Critical error
ERRMSG: Exception: Flash operation exited with code 1

I have deleted the wrong address in board.cmake, please help retry and test. I will update code according comment above on these several days.

lucien-nxp avatar Oct 12 '24 03:10 lucien-nxp

I have deleted the wrong address in board.cmake, please help retry and test. I will update code according comment above on these several days.

@Lucien-Zhao , now I can flash, but there is no console output for hello_world or any applications, and debug found the entry is error. please check.

hakehuang avatar Oct 13 '24 15:10 hakehuang

I have deleted the wrong address in board.cmake, please help retry and test. I will update code according comment above on these several days.

@Lucien-Zhao , now I can flash, but there is no console output for hello_world or any applications, and debug found the entry is error. please check.

Hi Hake, I suspect your boards is in wrong boot mode. Please check sw10 whether is on 01 status. Thank you.

lucien-nxp avatar Oct 15 '24 03:10 lucien-nxp

I created new pinctrl driver(iopctl driver) for RT 3 digital platforms, it makes better service the multi iopctl instances on RT700, and keep a same pinctrl model for RT 3 digital platforms. So this PR is currently dependent on my other PR#81086. I will make sure my other PR merge as soon as possible after the freeze ends.

lucien-nxp avatar Nov 15 '24 06:11 lucien-nxp

@lucien-nxp looks like there was a rebase accident :)

kartben avatar Nov 15 '24 07:11 kartben

@lucien-nxp looks like there was a rebase accident :) This PR is dependent on another #81086. I will speed another PR merged(when windows open), then rebase this PR the newest main node. Currently, only do ci test on this PR. Thank you.

lucien-nxp avatar Nov 15 '24 07:11 lucien-nxp

Hi @Raymond0225 , For Q1. Now iocon driver won't be used for RT 3 digital platforms. I have created new IOPCTL driver to service RT 3 digital platforms. For Q3, How can I use DT_INST_FOREACH_STATUS_OKAY ? Use DT_INST_FOREACH_STATUS_OKAY need to match with macro DT_DRV_COMPAT, how can I handle multi kinds of IPs.

lucien-nxp avatar Nov 20 '24 07:11 lucien-nxp

Hi @hakehuang , Could you help test all the LPC and RT3 digitals platforms based on this PR? I have updated iocon driver and pin header file for RT700. Thank you.

lucien-nxp avatar Nov 29 '24 09:11 lucien-nxp

Hi @hakehuang , Could you help test all the LPC and RT3 digitals platforms based on this PR? I have updated iocon driver and pin header file for RT700. Thank you.

sure, I kick another round of testing, will feedback once done

@lucien-nxp

op 500 values of testsuite.keyword Failed
tests/kernel/mem_protect/mem_protect/kernel.memory_protection 15
tests/kernel/mem_protect/userspace/kernel.memory_protection.userspace 1
tests/kernel/threads/thread_stack/kernel.threads.armv8m_mpu_stack_guard 1
tests/kernel/fatal/exception/kernel.common.stack_protection_armv8m_mpu_stack_guard 2
samples/userspace/prod_consumer/sample.userspace.prod_consumer 1
samples/userspace/shared_mem/sample.kernel.memory_protection.shared_mem 1

hakehuang avatar Dec 02 '24 06:12 hakehuang

Hi @danieldegrasse , Could you help review the current iocon driver and pinctrl model on RT700? I have updated them according to the model you provide.

lucien-nxp avatar Dec 04 '24 10:12 lucien-nxp

Hi @hakehuang , Could you help test all the LPC and RT3 digitals platforms based on this PR? I have updated iocon driver and pin header file for RT700. Thank you.

sure, I kick another round of testing, will feedback once done

@lucien-nxp

op 500 values of testsuite.keyword Failed tests/kernel/mem_protect/mem_protect/kernel.memory_protection 15 tests/kernel/mem_protect/userspace/kernel.memory_protection.userspace 1 tests/kernel/threads/thread_stack/kernel.threads.armv8m_mpu_stack_guard 1 tests/kernel/fatal/exception/kernel.common.stack_protection_armv8m_mpu_stack_guard 2 samples/userspace/prod_consumer/sample.userspace.prod_consumer 1 samples/userspace/shared_mem/sample.kernel.memory_protection.shared_mem 1

Hi Hake, These issue seems is caused by limited MPU region available on cm33 core. I have updated the code and try most of them, and it have been passed on my local. Could you help re-test?

lucien-nxp avatar Dec 05 '24 03:12 lucien-nxp

Hi @danieldegrasse , Could you help review the current iocon driver and pinctrl model on RT700? I have updated them according to the model you provide.

Hi @danieldegrasse , could you help review the current pinctrl model? Thank you.

lucien-nxp avatar Dec 05 '24 15:12 lucien-nxp

@lucien-nxp , board testing on RT700 works fine now. and RTxxx hello_world works as well..

hakehuang avatar Dec 13 '24 03:12 hakehuang

Only rebase to the newest node to resolve the west.yml conflict.

lucien-nxp avatar Dec 13 '24 06:12 lucien-nxp

Only rebase to the newest node to resolve the west.yml conflict.

lucien-nxp avatar Dec 13 '24 06:12 lucien-nxp

Only rebase to the newest node to resolve the west.yml conflict.

lucien-nxp avatar Dec 16 '24 02:12 lucien-nxp

Only rebase to the newest commit on main branch and resolve the west.yml conflicts.

lucien-nxp avatar Dec 19 '24 07:12 lucien-nxp

@nordicjm can you summarize what is needed to clear your change request? I'm having a hard time going through the comments in this PR to identify what @lucien-nxp needs to do to wrap this up.

dleach02 avatar Jan 08 '25 15:01 dleach02

@nordicjm can you summarize what is needed to clear your change request? I'm having a hard time going through the comments in this PR to identify what @lucien-nxp needs to do to wrap this up.

This outstanding part here has been waiting for an update: https://github.com/zephyrproject-rtos/zephyr/pull/79376#discussion_r1894160349

nordicjm avatar Jan 09 '25 07:01 nordicjm

@nordicjm can you summarize what is needed to clear your change request? I'm having a hard time going through the comments in this PR to identify what @lucien-nxp needs to do to wrap this up.

This outstanding part here has been waiting for an update: #79376 (comment)

Thank you for pointing out. Could you help recheck and give me a approvement if no problem?

lucien-nxp avatar Jan 13 '25 07:01 lucien-nxp

#83873 , issues have been resolved. Rebase to the newest commit node and do CI test again.

lucien-nxp avatar Jan 14 '25 01:01 lucien-nxp

board testing pass. only 3 cases with MPU region size limitation cases fail.

tests/kernel/sched/schedule_api/kernel.scheduler.multiq_no_timeslicing v4.0.0-3243-gd8054384cfd5 failed Timeout mimxrt700_evk/mimxrt798s/cm33_cpu0 tests/kernel/sched/schedule_api
tests/kernel/mem_heap/k_heap_api/kernel.k_heap_api v4.0.0-3243-gd8054384cfd5 error Device issue (Flash error?) mimxrt700_evk/mimxrt798s/cm33_cpu0 tests/kernel/mem_heap/k_heap_api
tests/kernel/mem_protect/userspace/kernel.memory_protection.userspace v4.0.0-3243-gd8054384cfd5 failed Failed harness:'Testsuite failed' mimxrt700_evk/mimxrt798s/cm33_cpu0 tests/kernel/mem_protect/userspace

hakehuang avatar Jan 14 '25 06:01 hakehuang

@hakehuang be careful removing DNM. This is set automatically due to the HAL side PR needing to be merged.

dleach02 avatar Jan 14 '25 12:01 dleach02

@nordicjm @iuliana-prodan @kartben @hakehuang need another round of +1 after merging the HAL and updating the west.yml

dleach02 avatar Jan 14 '25 13:01 dleach02