2013-11-13 01:54 AM
Hi everybody,
I was very happy to see uCLinux port for Cortex-M4 and my favorite MCU STM32. This well done job was achieved by emcraft. So I wonder that is it possible to run uCLinux on my new toy STM32F429I-DISCO? I have started for it and some u-boot and kernel patching I finished my first job. You must known that code execution from SDRAM on STM32F4 much slower than from FLASH (~6x times slower). So in fact this core is not suitable code execution from SDRAM. But maybe you don't have any chance so you can accept this penalty. Than I modified the kernel to load romfs from flash, simple frame buffer driver, u-boot patching for SDRAM and LCD init functions. You can try and decide for yourself. This is boot-up and simple framebuffer demo video. Emcraft original source git is https://github.com/EmcraftSystems (not including STM32F429I-DISCO board drivers)Sample image attached to the post. This image contains u-boot, kernel and romfs. The serial console is USART3 and PC10->MCU TX, PC11->MCU RX. Don't forget that this interface has TTL levels. #usart #stm32-uclinux-u-boot #usb-driver-p19-stm324f2013-12-07 07:06 AM
Hi guys,
uCLinux, u-boot source and romfs binary is ready on . Needed toolchain can be downloaded from emraft web site. Don't forget that u-boot must be flashed on 0x08000000, kernel must be flashed 0x08020000 and romfs must be flashed 0x08120000 address. If you want change these address, some jobs are waiting for you.2013-12-08 10:13 PM
Hi TMK,
When compilling u-boot source I got the follwing error:u-boot/stm32429-disco/include/config.h:4: fatal error: configs/stm32429-disco.h: No such file or directoryThere is no stm32429-disco .h config file in the source tree.2013-12-08 10:38 PM
Opps! Sorry guys. Some files was missing. I updated the repository. Please check it again.
2013-12-16 01:51 AM
Hi TMK,
Would you pls show me how to build the romfs file system ? Is it possible to use buildroot tool for STM32F4-DISCO ?Thank you very much.2013-12-16 04:14 PM
I was able to compile everything
I can flash u-boot and uclinux however when I do the romfs I get this error root@bench:/share/embedded/ARM/stm32/STM32F429I-DISCO/uclinux/stm32-bins# st-flash write romfs.bin 0x08120000 2013-12-16T19:07:09 INFO src/stlink-usb.c: -- exit_dfu_mode 2013-12-16T19:07:09 INFO src/stlink-common.c: Loading device parameters.... 2013-12-16T19:07:09 INFO src/stlink-common.c: Device connected is: F42x and F43x device, id 0x10036419 2013-12-16T19:07:09 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x200000 bytes (2048 KiB) in pages of 16384 bytes 2013-12-16T19:07:09 INFO src/stlink-common.c: Attempting to write 346112 (0x54800) bytes to stm32 address: 135397376 (0x8120000) EraseFlash - Sector:0xd Size:0x20000 Flash page at addr: 0x08120000 erasedEraseFlash - Sector:0xe Size:0x20000 Flash page at addr: 0x08140000 erasedEraseFlash - Sector:0xf Size:0x20000 Flash page at addr: 0x08160000 erased 2013-12-16T19:07:09 INFO src/stlink-common.c: Finished erasing 3 pages of 131072 (0x20000) bytes 2013-12-16T19:07:09 INFO src/stlink-common.c: Starting Flash write for F2/F4 2013-12-16T19:07:09 INFO src/stlink-common.c: Successfully loaded flash loader in sram size: 32768 size: 32768 size: 32768 size: 32768 size: 32768 size: 32768 size: 32768 size: 32768 size: 32768 size: 32768 size: 18432 2013-12-16T19:07:17 INFO src/stlink-common.c: Starting verification of write complete 2013-12-16T19:07:17 ERROR src/stlink-common.c: Verification of flash failed at offset: 0 stlink_fwrite_flash() == -12013-12-16 06:06 PM
Hi gore.mike
You can try STM32 ST-LINK Utility on Windows. I'm using it and flashed image OK.2013-12-16 08:39 PM
Hi phuong.dang_minh
Thanks for the tip about windows - I will try that. Does the romfs.bin file have to be processed before flashing ? I already found that I had to process vmlinux with objcopy before I wrote it like this: arm-uclinuxeabi-objcopy -O binary vmlinux vmlinux.bin echo ST-LINK flash st-flash --reset write vmlinux.bin 0x080200002013-12-16 10:08 PM
2013-12-17 01:19 PM
If I run make_uboot_ximage I see error:
''mkimage: For XIP, the entry point must be the load addr + 64''What is wrong?
2013-12-18 12:34 AM
Hi uC_KG,
The script just copy 64 bytes 0xFF data to the front of compiled XIP image binary. Then it uses mkimage tool for create u-boot header. for dummy 64 bytes, the script need to be ''tempfile'' that just contains 64 bytes 0xFF. So the other things seem in the file. if ''tempfile'' is not in the boot directory, you can see some error as you know.