Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

armv7m7-imxrt117x: system freeze after using sysexec psh, soon after system startup #1103

Open
mateusz-bloch opened this issue Jun 21, 2024 · 2 comments
Labels

Comments

@mateusz-bloch
Copy link
Contributor

mateusz-bloch commented Jun 21, 2024

The system freezes after entering 'sysexec psh' as soon after system startup. This issue arises with following the change armv7m/pmap: Add missing spinlock in the kernel.

Example:

�Phoenix-RTOS loader v. 1.21 rev: 8e760cc
hal: Cortex-M i.MX RT117x
dev/usb: Initializing usb-cdc(1.2)
dev/flash: Initialized flexspi1
dev/flash/nor: Probing flash id 0x0018709d on port 1.0
dev/flash/nor: Configured ISSI IS25WP128 16MB nor flash(2.0)
dev/pipe: Initialized rtt channel(8.0)
cmd: Executing pre-init script
console: Setting console to 0.0
Waiting for input,     0 [ms]    
Phoenix-RTOS microkernel v. 3.2 rev: 1508c43
hal: NXP i.MX RT117x ARMv7 Cortex-M7 r1 p2
hal: FPU, MPU, Thumb
hal: Using NVIC interrupt controller
hal: Using General Purpose Timer
vm: Initializing page allocator 10/160 KB, page_t=12
vm: Initializing memory mapper: (72*80) 5760
vm: Initializing kernel memory allocator: (16*48) 768
vm: Initializing memory objects
proc: Initializing thread scheduler, priorities=8
syscalls: Initializing syscall table [100]
main: Starting syspage programs: 'dummyfs', 'imxrt-multi', 'psh'
dummyfs: initialized
(psh)% sysexec psh


Edit:
It also freezes after these changes when I add executing tests in a new psh, as shown in this PR:

Example:

Phoenix-RTOS loader v. 1.21 rev: 8e760cc
hal: Cortex-M i.MX RT117x
dev/usb: Initializing usb-cdc(1.2)
dev/flash: Initialized flexspi1
dev/flash/nor: Probing flash id 0x0018709d on port 1.0
dev/flash/nor: Configured ISSI IS25WP128 16MB nor flash(2.0)
dev/pipe: Initialized rtt channel(8.0)
cmd: Executing pre-init script
console: Setting console to 0.0
Waiting for input,  1800 [ms]Phoenix-RTOS loader v. 1.21 rev: 8e760cc
hal: Cortex-M i.MX RT117x
dev/usb: Initializing usb-cdc(1.2)
dev/flash: Initialized flexspi1
dev/flash/nor: Probing flash id 0x0018709d on port 1.0
dev/flash/nor: Configured ISSI IS25WP128 16MB nor flash(2.0)
dev/pipe: Initialized rtt channel(8.0)
cmd: Executing pre-init script
console: Setting console to 0.0
Waiting for input,     0 [ms]    
Phoenix-RTOS microkernel v. 3.2 rev: 190338b
hal: NXP i.MX RT117x ARMv7 Cortex-M7 r1 p2
hal: FPU, MPU, Thumb
hal: Using NVIC interrupt controller
hal: Using General Purpose Timer
vm: Initializing page allocator 10/160 KB, page_t=12
vm: Initializing memory mapper: (72*80) 5760
vm: Initializing kernel memory allocator: (16*48) 768
vm: Initializing memory objects
proc: Initializing thread scheduler, priorities=8
syscalls: Initializing syscall table [100]
main: Starting syspage programs: 'dummyfs', 'imxrt-multi', 'psh'
dummyfs: initialized
(psh)% dmesg -D
(psh)% sysexec psh
(psh)% !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 
Unknown command!
(psh)% echo $?
127
(psh)% 
(psh)% echo $?
0
(psh)%  ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿
Unknown command!
(psh)% exit
(psh)% dmesg -E
(psh)% 
phoenix-rtos-tests/psh/gibber: OK
phoenix-rtos-tests/psh/auth: ...

(psh)% dmesg -D
(psh)% sysexec psh


Or:

Phoenix-RTOS loader v. 1.21 rev: 8e760cc
hal: Cortex-M i.MX RT117x
dev/usb: Initializing usb-cdc(1.2)
dev/flash: Initialized flexspi1
dev/flash/nor: Probing flash id 0x0018709d on port 1.0
dev/flash/nor: Configured ISSI IS25WP128 16MB nor flash(2.0)
dev/pipe: Initialized rtt channel(8.0)
cmd: Executing pre-init script
console: Setting console to 0.0
Waiting for input,     0 [ms]    
Phoenix-RTOS microkernel v. 3.2 rev: 190338b
hal: NXP i.MX RT117x ARMv7 Cortex-M7 r1 p2
hal: FPU, MPU, Thumb
hal: Using NVIC interrupt controller
hal: Using General Purpose Timer
vm: Initializing page allocator 10/160 KB, page_t=12
vm: Initializing memory mapper: (72*80) 5760
vm: Initializing kernel memory allocator: (16*48) 768
vm: Initializing memory objects
proc: Initializing thread scheduler, priorities=8
syscalls: Initializing syscall table [100]
main: Starting syspage programs: 'dummyfs', 'imxrt-multi', 'psh'
dummyfs: initialized
(psh)% dmesg -D
(psh)% sysexec psh
(psh)% exit
(psh)% dmesg -E
(psh)% 
phoenix-rtos-tests/psh/prompt: OK
phoenix-rtos-tests/psh/autocompletion: ...

(psh)% dmesg -D
(psh)% sysexec psh


@agkaminski
Copy link
Member

agkaminski commented Jun 21, 2024

@mateusz-bloch Only thing that comes to my mind regarding this issue is that perhaps syspage mpu data is overwritten after init. Could you please check this change?
phoenix-rtos/phoenix-rtos-kernel#563

@mateusz-bloch
Copy link
Contributor Author

@mateusz-bloch Only thing that comes to my mind regarding this issue is that perhaps syspage mpu data is overwritten after init. Could you please check this change? phoenix-rtos/phoenix-rtos-kernel#563

After a quick look, I don't see any changes regarding this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants