stuck in starting kernel (uclinux) on stm32f429 custom board

1.1k Views Asked by At

I’ve ported uboot and uclinux on my DISCO board (stm32f429-disco) using robotest files on github recently. Now I’m trying to port them on my custom board which uses:

  • UART6 instead of UART3
  • a 12 MHz oscillator instead of the 8 MHz usedin DISCO
  • a 128 Mb SDRAM instead of the one used in DISCO
  • uses SDRAM bank 1 instead of bank2(start address is 0xC0000000 instead of 0xD0000000).

So I made some changes on uboot tree:

  • u-boot-master\board\stm\stm32429-disco\board.c
  • u-boot-master\cpu\arm_cortexm3\stm32\clock.c
  • u-boot-master\cpu\arm_cortexm3\stm32\fmc.c
  • u-boot-master\include\asm-arm\arch-stm32\fmc.h
  • u-boot-master\include\configs\stm32429-disco.h

And also I made some changes on ucliux tree:

  • uclinux-master\config.rubotest
  • uclinux-master\arch\arm\mach-stm32

when I make images and load them on my board I got the following result:

     U-Boot 2010.03 (Jun 09 2017 - 06:48:57)

CPU  : STM32F4 (Cortex-M4)
Freqs: SYSCLK=180MHz,HCLK=180MHz,PCLK1=45MHz,PCLK2=90MHz
Board: STM32F429II-SADR board,Rev 1.0
DRAM:   8 MB
Using default environment

Hit any key to stop autoboot:  0
## Booting kernel from Legacy Image at 08020000 ...
   Image Name:   Linux-2.6.33-arm1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    889248 Bytes = 868.4 kB
   Load Address: 08020040
   Entry Point:  08020041
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...    

And the kernel stucks in here and then nothing happens. I wonder if the problem is related to uboot or the kernel and what it is!!! guys it’s been more than a month I’m working on this project and I’ really exhausted. Any helps would be appreciated. best regards.

I changed the load address and entery point to 0x08008000 and 0x08008001 and this is the result:

    `U-Boot 2010.03 (Jun 09 2017 - 06:48:57)

CPU  : STM32F4 (Cortex-M4)
Freqs: SYSCLK=180MHz,HCLK=180MHz,PCLK1=45MHz,PCLK2=90MHz
Board: STM32F429II-SADR board,Rev 1.0
DRAM:   8 MB
Using default environment

Hit any key to stop autoboot:  0
## Booting kernel from Legacy Image at 08020000 ...
   Image Name:   Linux-2.6.33-arm1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    889312 Bytes = 868.5 kB
   Load Address: 08008000
   Entry Point:  08008001
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

UNHANDLED EXCEPTION: HARD FAULT
  R0    = 00000000  R1  = 0002ec05
  R2    = 0002ec04  R3  = 1ffec3bd
  R12   = 00000030  LR  = 0800c67b
  PC    = 08008074  PSR = 21000000`

And this is the result of printenv :

    STM32429-DISCO> printenv
bootcmd=run flashboot
bootdelay=0
baudrate=115200
hostname=stm32429-disco
loadaddr=0xC0000000
addip=setenv bootargs ${bootargs}
flashaddr=08020000
flashboot=run addip;bootm ${flashaddr}
image=uImage
stdin=serial
stdout=serial
stderr=serial
bootargs=stm32_platform=stm32429-disco mem=7M console=ttyS2,115200n8 
consoleblan
k=0 root=/dev/mtdblock0 rdinit=/sbin/init 
video=vfb:enable,fbmem:0x90700000,fbsi
ze:0x100000

Environment size: 412/1020 bytes
STM32429-DISCO>

loadaddr was 0x90000000 at first, and the hacker had used memrmp register to remap it in to 0xD000000 (at DISCO board 0xD0000000 is the start of SDRAM bank). I commented the memrmp line in fmc.c and there was no any remap anymore. I also changed the #define CONFIG_SYS_RAM_BASE from 0x90000000 to 0xC0000000 at include/config/stm32f429 file. I changed SDRAM bank address from 0xD0000000 to 0xC0000000 at fmc.h file ,too.

0

There are 0 best solutions below