title: stuck in starting kernel (uclinux) on stm32f429 custom board
body: <p>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:</p>
  
  <ul>
  <li>UART6 instead of UART3</li>
  <li>a 12 MHz oscillator instead of the 8 MHz usedin DISCO  </li>
  <li>a 128 Mb SDRAM instead of the one used in DISCO </li>
  <li>uses SDRAM bank 1 instead of bank2(start address is 0xC0000000 instead of 0xD0000000).</li>
  </ul>
  
  <p>So I made some changes on uboot tree:</p>
  
  <ul>
  <li>u-boot-master\board\stm\stm32429-disco\board.c</li>
  <li>u-boot-master\cpu\arm_cortexm3\stm32\clock.c   </li>
  <li>u-boot-master\cpu\arm_cortexm3\stm32\fmc.c       </li>
  <li>u-boot-master\include\asm-arm\arch-stm32\fmc.h</li>
  <li>u-boot-master\include\configs\stm32429-disco.h</li>
  </ul>
  
  <p>And also I made some changes on ucliux tree:</p>
  
  <ul>
  <li>uclinux-master\config.rubotest </li>
  <li>uclinux-master\arch\arm\mach-stm32</li>
  </ul>
  
  <p>when I make images and load them on my board I got the following result:</p>
  
  <pre><code>     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 ...    
  </code></pre>
  
  <p>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.</p>
  
  <p>I changed the load address and entery point to 0x08008000 and 0x08008001 and this is the result:</p>
  
  <pre><code>    `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`
  </code></pre>
  
  <p>And this is the result of <em>printenv</em> :</p>
  
  <pre><code>    STM32429-DISCO&gt; 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&gt;
  </code></pre>
  
  <p><em>loadaddr</em> was <em>0x90000000</em> at first, and the hacker had used <em>memrmp</em> register to remap it in to <em>0xD000000</em> (at DISCO board <em>0xD0000000</em> 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 <em>#define CONFIG_SYS_RAM_BASE</em> from <em>0x90000000</em> to <em>0xC0000000</em> at include/config/stm32f429 file.
  I changed SDRAM bank address from <em>0xD0000000</em> to <em>0xC0000000</em> at fmc.h file ,too.</p>