Linux kernel panic after downloading binary via TFTP to SRAM from U-Boot

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

Linux kernel panic after downloading binary via TFTP to SRAM from U-Boot

2,467 Views
kawin
Contributor III

I'm seeing kernel panic error when starting Linux (A53) after downloading M7 .bin firmware from TFTP server to SRAM region. When I tried the same with SD card, everything works without error. To see the error, I only had to call tftp from U-Boot like so tftp 0x34300000 firmware.bin, it is not necessary to call startm7 or run the binary.

As a side note, I don't think this is a file transfer problem as I have ran nfsboot many times without issue. The problem seems to be related to tftp and sram

I have tried below configurations:

  • Linux BSP 30.0 and 29.0HF1
  • RTD 3.0 and RTD 2.0HF2

 

 

 

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]                                                                                                                                                                                                          
[    0.000000] Linux version 5.10.41-rt42+g98b692708f63 (oe-user@oe-host) (aarch64-fsl-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Thu Aug 19 13:51:06 UTC 2021                                                                                        
[    0.000000] Machine model: Freescale S32G274                                                                                                                                                                                                                                 
[    0.000000] earlycon: linflex0 at MMIO 0x00000000401c8000 (options '115200n8')                                                                                                                                                                                               
[    0.000000] printk: bootconsole [linflex0] enabled                                                                                                                                                                                                                           
[    0.000000] SError Interrupt on CPU0, code 0xbf000002 -- SError                                                                                                                                                                                                              
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.41-rt42+g98b692708f63 #1                                                                                                                                                                                            
[    0.000000] Hardware name: Freescale S32G274 (DT)                                                                                                                                                                                                                            
[    0.000000] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)                                                                                                                                                                                                             
[    0.000000] pc : setup_arch+0x164/0x58c                                                                                                                                                                                                                                      
[    0.000000] lr : setup_arch+0x15c/0x58c                                                                                                                                                                                                                                      
[    0.000000] sp : ffffffc010c43ef0                                                                                                                                                                                                                                            
[    0.000000] x29: ffffffc010c43ef0 x28: 0000000080b00018                                                                                                                                                                                                                      
[    0.000000] x27: 00000000fff3d830 x26: 0000000000000000                                                                                                                                                                                                                      
[    0.000000] x25: 00000000fffcf110 x24: 00000000ffd48cd8                                                                                                                                                                                                                      
[    0.000000] x23: ffffffc010000000 x22: ffffffc010c4e280                                                                                                                                                                                                                      
[    0.000000] x21: ffffffc010ce1000 x20: fffffffefe7f208c                                                                                                                                                                                                                      
[    0.000000] x19: ffffffc010c96e98 x18: 0000000000000030                                                                                                                                                                                                                      
[    0.000000] x17: 0000000000001800 x16: 0000000000000000                                                                                                                                                                                                                      
[    0.000000] x15: ffffffc010c4e6e8 x14: ffffffffffffffff                                                                                                                                                                                                                      
[    0.000000] x13: 0000000000000000 x12: 0000000000000028                                                                                                                                                                                                                      
[    0.000000] x11: 0000000000000015 x10: 0101010101010101                                                                                                                                                                                                                      
[    0.000000] x9 : 3334ff6b6e6e6f5e x8 : 7f7f7f7f7f7f7f7f                                                                                                                                                                                                                      
[    0.000000] x7 : 736d647164676e62 x6 : 000006161d090b74                                                                                                                                                                                                                      
[    0.000000] x5 : 740b091d16060000 x4 : 0000000000000000                                                                                                                                                                                                                      
[    0.000000] x3 : ce6ded8ca0000000 x2 : 000000000000000c                                                                                                                                                                                                                      
[    0.000000] x1 : 0000000000000000 x0 : 0000000000000080                                                                                                                                                                                                                      
[    0.000000] Kernel panic - not syncing:                                                                                                                                                                                                                                      
[    0.000000] Asynchronous SError Interrupt                                                                                                                                                                                                                                    
[    0.000000] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---  

 

 

 

 

0 Kudos
5 Replies

886 Views
yellapu_anishkh
Contributor IV

Hi,

I am facing similar issue, when i ran M7 binary from uboot 0x34300000 and boot linux ended up with kernel panic.

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.10.145-rt74+g1594b25154a2 (oe-user@oe-host) (aarc h64-fsl-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Tue Nov 29 10:33:39 UTC 2022
[ 0.000000] Machine model: NXP S32G399A-RDB3
[ 0.000000] earlycon: linflex0 at MMIO 0x00000000401c8000 (options '115200n8' )
[ 0.000000] printk: bootconsole [linflex0] enabled
[ 0.000000] SError Interrupt on CPU0, code 0xbf000000 -- SError
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.145-rt74+g1594b25154 a2 #1
[ 0.000000] Hardware name: NXP S32G399A-RDB3 (DT)
[ 0.000000] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
[ 0.000000] pc : setup_arch+0x164/0x58c
[ 0.000000] lr : setup_arch+0x15c/0x58c
[ 0.000000] sp : ffffffc010ca3ef0
[ 0.000000] x29: ffffffc010ca3ef0 x28: 0000000080b50018
[ 0.000000] x27: 00000000ffaa27f8 x26: 0000000000000000
[ 0.000000] x25: 00000000ffb3a738 x24: 00000000ffe21f28
[ 0.000000] x23: ffffffc010d44000 x22: ffffffc010cae380
[ 0.000000] x21: fffffffefe600094 x20: ffffffc010cf71d8
[ 0.000000] x19: ffffffc010000000 x18: 0000000000000030
[ 0.000000] x17: 0000000000001800 x16: 0000000000000000
[ 0.000000] x15: ffffffc010cae7e8 x14: ffffffffffffffff
[ 0.000000] x13: 0000000000000000 x12: 0000000000000028
[ 0.000000] x11: 0000000000000015 x10: 0101010101010101
[ 0.000000] x9 : 3334ff6b6e6e6f5e x8 : 7f7f7f7f7f7f7f7f
[ 0.000000] x7 : 736d647164676e62 x6 : 000006161d090b74
[ 0.000000] x5 : 740b091d16060000 x4 : 0000000000000000
[ 0.000000] x3 : ce6ded8ca0000000 x2 : 000000000000000c
[ 0.000000] x1 : 0000000000000000 x0 : 0000000000000080
[ 0.000000] Kernel panic - not syncing:
[ 0.000000] Asynchronous SError Interrupt
[ 0.000000] ---[ end Kernel panic - not syncing: Asynchronous SError Interrup t ]---

0 Kudos

2,385 Views
kawin
Contributor III

Any updates on this?

0 Kudos

2,363 Views
tristan_mcdaniel
NXP TechSupport
NXP TechSupport

Hi Kawin,

Apologies for the late response. When attempting to replicate the issue on our side, we did not see any kernel panics. Outlined below are the steps that we took using the basic LED example from the software enablement guide. As a next step, I would ask you to try to replicate the following steps as well with your M7 binary to see if the kernel panic still occurs. This will give a starting point with a procedure that has been tested to work. In the meantime, if this procedure deviates from the steps you took, please let us know by including the u-boot commands used for loading the M7 binary, u-boot environment variables set, and any relevant changes made to the Linux BSP 30.0 image during the build process.

  1. Flash pre-build Linux BSP 30.0 fsl-image-auto image from Flexera
  2. Setup the TFTP server on a PC running Linux (in our case, Ubuntu 18.04 LTS was used). For this, we used the "Setting up a TFTP server" instructions from this arm community article.
    1. Note that the binary from the LED example project will be stored in the tftpboot folder on the PC versus their test file
  3. Obtain the IP address of the PC running linux through the following command. This will be referred to as <tftp_server_ip_addr> in the following steps.
    $ ifconfig -a
  4. Connect PFE2 ethernet port of the S32G2 board to your local network. In the case of the RDB2/GoldBox, this is port P3B.
    tristan_mcdaniel_0-1642441823481.png

     

  5. Boot the board, enter the u-boot console and enter the following commands:
    => initsram 0x34100000 0x700000
    => dhcp
    => tftp 0x34300000 <tftp_server_ip_addr>:led_example_M7_0.bin
    => startm7 0x34501000
    1. Note that the dhcp command will attempt to load image files such as 'C0A0158.img' once it successfully connects and obtains an IP address. You can either cancel the command at that point using Ctrl+C or wait for the load to fail.
0 Kudos

2,344 Views
kawin
Contributor III

Hi Tristan,

I think I might be going crazy. Can't tell you how many times I have tested this exact same boot flow previously. Let me try it again and get back to you on this.

Also do you have any idea what might cause segmentation fault when running IPCF userspace example? https://community.nxp.com/t5/S32G/Segmentation-Fault-in-IPCF-Userspace-Example/td-p/1400905

Thank you,

Kawin 

0 Kudos

2,448 Views
tristan_mcdaniel
NXP TechSupport
NXP TechSupport

Hi Kawin,

I am working to replicate the issue and will provide an update once I have some results from my test.

Thanks,
Tristan

0 Kudos