U-Boot

Nov 26, 2011 at 4:34 PM

Hi all,

Sorry for my English, I'm Spanish.

This porject is very interesting and is a big work.

I'm interesting in program in .NET Micro, and I have a MINI2440 (64MB).

My cuestion is how I can load the tinyclr.bin in the MINI2440. I have the U-Boot loaded. What is the next step?

 

Thank you.

 

Coordinator
Nov 26, 2011 at 9:20 PM
Edited Nov 26, 2011 at 9:23 PM

Hi

I have board with 256 MB, but it looks like you are lucky. tinyclr.bin is configured to use RAM address space from 0x30000000 to 0x34000000 (64 MB). You can look it from file Trunk\Solutions\Micro2440SDK\TinyCLR\scatterfile_tinyclr_gcc.xml (http://s3c2440mfport.codeplex.com/SourceControl/changeset/view/8229#108497). I think that MINI2440 has just that address space available in RAM.

I think you should be able to deploy tinyclr.bin to RAM and run it there.

I deploy tinyclr.bin using these U-Boot environment variables:

bootcmd=dhcp;run boottftp;go 0x30000000
boottftp=tftpboot 0x30000000 tinyclr.bin

bootcmd is automatically executed when count down is not interrupted. You can look all the variables from http://www.denx.de/wiki/DULG/UBootEnvVariables.

I use TFTP to transfer tinyclr to FriendlyARM. You can use any transfer method. It's important that you deploy the file to address 0x30000000 and run it from the same address using "go 0x30000000"-command. 

Nov 27, 2011 at 9:51 AM

Thank you,

I'm trying to load u-Boot into MINI2440, please see below the step (I'm not sure if is the correct for):

##### FriendlyARM BIOS for 2440 #####

[x] bon part 0 320k 2368k

[v] Download vivi

[k] Download linux kernel

[y] Download root_yaffs image

[a] Absolute User Application

[n] Download Nboot

[l] Download WinCE boot-logo

[w] Download WinCE NK.bin

[d] Download & Run

[z] Download zImage into RAM

[g] Boot linux from RAM

[f] Format the nand flash

[b] Boot the system

[s] Set the boot parameters

[u] Backup NAND Flash to HOST through USB(upload)

[r] Restore NAND Flash from HOST through USB

[q] Goto shell of vivi

[i] Version: 1026-12

Enter your selection: q

 

Supervivi> load ram 0x32000000 246164 u-boot

USB host is connected. Waiting a download.

Now, Downloading [ADDRESS:32000000h,TOTAL:246174]

RECEIVED FILE SIZE: 246174 (240KB/S, 1S)

Downloaded file at 0x32000000, size = 246164 bytes

 

Supervivi> go 0x32000000

go to 0x32000000

argument 0 = 0x00000000

argument 1 = 0x00000000

arguá

U-Boot 1.3.2-mini2440 (May 25 2010 - 19:15:21)

I2C:   ready

DRAM: 64 MB

Flash: 2 MB

NAND: 64 MiB

*** Warning - bad CRC or NAND, using default environment

USB:   S3C2410 USB Deviced

In:   serial

Out:   serial

Err:   serial

MAC: 08:08:11:18:12:27

Hit any key to stop autoboot: 0

 

MINI2440 # nand scrub

NAND scrub: device 0 whole chip

Warning: scrub option will erase all factory set bad blocks!

         There is no reliable way to recover them.

         Use this command only for testing purposes if you

         are sure of what you are doing!

Really scrub this NAND flash? <y/N>

Erasing at 0x3ffc000 -- 100% complete.

Bad block table not found for chip 0

Bad block table not found for chip 0

OK

 

MINI2440 # nand createbbt

Create BBT and erase everything ? <y/N>

Skipping bad block at 0x03ff0000

Skipping bad block at 0x03ff4000

Skipping bad block at 0x03ff8000

Skipping bad block at 0x03ffc000

Creating BBT. Please wait ...Bad block table not found for chip 0

Bad block table not found for chip 0

Bad block table written to 0x03ffc000, version 0x01

Bad block table written to 0x03ff8000, version 0x01

 

MINI2440 # nand write.e 0x32000000 0x0 0x3c194

NAND write: device 0 offset 0x0, size 0x3c194

Writing data at 0x3c000 -- 100% complete.

246164 bytes written: OK

 

Reset the MINI2440

 

U-Boot 1.3.2-mini2440 (May 25 2010 - 19:15:21)

I2C:   ready

DRAM: 64 MB

Flash: 2 MB

NAND: 64 MiB

*** Warning - bad CRC or NAND, using default environment

USB:   S3C2410 USB Deviced

In:   serial

Out:   serial

Err:   serial

MAC: 08:08:11:18:12:27

Hit any key to stop autoboot: 0

 

MINI2440 # mmcinit

mmc: Probing for SDHC ...

===============> MMC CMD Timeout

mmc: No answer to CMD8 trying SD

trying to detect SD Card...

Manufacturer:       0x02, OEM "TM"

Product name:       "SD256", revision 0.7

Serial number:     1899884907

Manufacturing date: 11/2004

CRC:               0x0c, b0 = 1

READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=77

size = 4292870144

SD Card detected RCA: 0xfb8f type: SD

 

MINI2440 # fatload mmc 0:1 0x30000000 tinyclr.bin

reading tinyclr.bin

635696 bytes read

 

MINI2440 # go 0x30000000

## Starting application at 0x30000000 ...

Bootstrap - CPU_IsMMUEnabled: 0

Bootstrap - CPU_IsMMUEnabled: 1

S3C2440_AIC_Driver::Initialize

STUB_ISR 25

ERROR: ABORT Dataver::Initialize COM0

cpsr=0x6000005f

pc =0x3005f22c

lr =0x3005f300

r0=0x63fc238e

r1=0x3008c18c

r2=0x00000000

r3=0x63fc238e

r4=0x30000000

r5=0x33d5fc68

r6=0x00000001

r7=0x33d5fdf5

r8=0x33d5ffdc

r9=0x00000000

r10=0x33d5fcf5

r11=0x33d5fdf5

r12=0x3005f3b4

sp =0x33eff600

ERROR: ABORT Data

cpsr=0x6000005f

pc =0x3005f22c

lr =0x3005f300

r0=0x63fc238e

r1=0x3008c18c

r2=0x00000000

r3=0x63fc238e

r4=0x30000000

r5=0x33d5fc68

r6=0x00000001

r7=0x33d5fdf5

r8=0x33d5ffdc

r9=0x00000000

r10=0x33d5fcf5

r11=0x33d5fdf5

r12=0x3005f3b4

sp =0x33eff600

[0x33eff600] : 00 00 00 00 8e 23 fc 63 08 00 00 00 70 f6 ef 33 ....Ž#üc....pöï3

[0x33eff610] : 00 00 30 30 00 f3 05 30 00 40 00 00 8e 23 fc 63 ..00.ó.0.@..Ž#üc

[0x33eff620] : 30 00 00 00 a4 f4 05 30 00 00 00 00 01 00 00 00 0...¤ô.0........

[0x33eff630] : 30 00 00 00 dc 1f 00 00 00 00 00 00 00 00 00 00 0...Ü...........

[0x33eff640] : 8c c1 08 30 8e 23 fc 63 ac 00 00 00 8e 23 fc 63 ŒÁ.0Ž#üc¬...Ž#üc

[0x33eff650] : 08 00 00 00 38 f6 05 30 00 00 00 00 8c f6 ef 33 ....8ö.0....Œöï3

[0x33eff660] : 00 00 00 00 34 00 00 00 50 00 00 00 8c c1 08 30 ....4...P...ŒÁ.0

[0x33eff670] : 00 00 30 30 00 40 00 00 01 00 00 00 dc 1f 00 00 ..00.@......Ü...

[0x33eff680] : 00 00 00 00 8e 23 fc 63 00 00 00 30 b4 f7 05 30 ....Ž#üc...0´÷.0

[0x33eff690] : 00 00 00 00 34 00 00 00 50 00 00 00 8c c1 08 30 ....4...P...ŒÁ.0

[0x33eff6a0] : 01 00 00 00 c0 03 06 30 08 00 00 00 00 00 00 00 ....À..0........

[0x33eff6b0] : 50 00 00 00 00 00 00 00 00 00 00 00 a8 e7 05 30 P...........¨ç.0

[0x33eff6c0] : 01 00 00 00 d0 04 06 30 00 00 00 30 20 30 06 30 ....Ð..0...0 0.0

[0x33eff6d0] : 00 00 00 30 1c 36 06 30 0d f0 ad ba 0d f0 ad ba ...0.6.0.ð­º.ð­º

[0x33eff6e0] : 0d f0 ad ba 00 00 00 00 00 00 00 00 00 00 00 00 .ð­º............

[0x33eff6f0] : fc ff ff 32 00 00 00 33 00 00 00 00 44 00 00 30 ü 2...3....D..0

Coordinator
Nov 27, 2011 at 11:46 AM

It looks like you loaded tinyclr.bin correctly and it started, but then crashed in or just after function S3C2440_USART_Driver::Initialize (file DeviceCode\Targets\Native\S3C2440\DeviceCode\S3C2440_USART\S3C2440__USART.cpp). 

BOOL S3C2440_USART_Driver::Initialize( int comPort, int BaudRate, int Parity, int DataBits, int StopBits, int FlowValue )
{
	S3C2440::Debug_printf("S3C2440_USART_Driver::Initialize COM%d\r\n", comPort);
	S3C2440_USART &usart = S3C2440::USART(comPort);
      
...

Then the execution maybe jumped to micro framework function "ABORTD_Handler" in file DeviceCode\cores\arm\Diagnostics\Aborts.cpp.

Can you try to compile own binary file and debug where it crashes?

Feb 13, 2012 at 12:49 PM

Hi Matti,

I replied a few times to a post at Friendly Arm but I guess you'd not visited the page in a long while so I thought I'd post here instead. I've managed to get my system (pc) up and going with the correct version of gcc and v4.1 of the micro framework. The Micro2440SDK solution builds but when I deploy this to adress 0x30000000 (the correct one for my board which is a knock off called a GT2440), I get the first line "Bootstrap - CPU_IsMMUEnabled: 0" but then nothing else! I also can't seem to get any debug information out of the comm port, I'll try another port later after I make an adaptor board up (the other UART is on a pin header).

Do you have any suggestions as to where to look and also what needs to be done? I've noticed that the interrupt handler isn't complete and so are the time / timer drivers which the framework documentation says are required to get the basics running, have there been any updates to your code?

Many thanks and hopefully sometime soon I can get on with having a go at developing the rest of the drivers (most likely with some help).

Dan

Coordinator
Feb 15, 2012 at 8:49 PM
Hi Dan

You right, I haven't followed the Friendly Arm forum, but I get email notification from the codeplex project so you can always get in touch with me from there.

There's a lot of things that i skipped when implementing the drivers. I only implemented everything that I needed to get a managed program running in my board.

Here are some points you can check:


Have you build the framework for RAM deployment? Only RAM deployment is implemented. I use following build commands in Eclipse.

Eclipse project properties
C/C++ Build:
Builder Settings:
Build command: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe dotNetMF.proj /p:flavor=${ConfigName};memory=ram
Behaviour:
Build (Incremental build): /t:deploy
Clean: /t:clean



If that doesn't help:

The error might be somewhere in the bootstrap Memory Management Unit initialization. When I start framework, I get following output:
Bootstrap - CPU_IsMMUEnabled: 0
Bootstrap - CPU_IsMMUEnabled: 1

The output is written in boostrap function "BootstrapCode_MMU". The first line is written when function is entered and second line is written when function exits.

Bootstrap code is in MicroFrameworkPK_v4_1\DeviceCode\Targets\Native\S3C2440\DeviceCode\S3C2440_Bootstrap\S3C2440_Bootstrap.cpp


MMU is initialized, because framework needs to write data to memory starting at virtual address 0x00000000. MMU maps physical address 0x33F00000 ~ 0x33FFFFFF to 0x0 ~ 0xFFFFF.

In scatterfile this region is defined like this:
<LoadRegion Name="RELOC_RAM" Base="0x00000000" Size="0x000FC000"/>
Scatter file is in:
MicroFrameworkPK_v4_1\Solutions\Micro2440SDK\TinyCLR\scatterfile_tinyclr_gcc.xml




2012/2/13 DanRiches <notifications@codeplex.com>

From: DanRiches

Hi Matti,

I replied a few times to a post at Friendly Arm but I guess you'd not visited the page in a long while so I thought I'd post here instead. I've managed to get my system (pc) up and going with the correct version of gcc and v4.1 of the micro framework. The Micro2440SDK solution builds but when I deploy this to adress 0x30000000 (the correct one for my board which is a knock off called a GT2440), I get the first line "Bootstrap - CPU_IsMMUEnabled: 0" but then nothing else! I also can't seem to get any debug information out of the comm port, I'll try another port later after I make an adaptor board up (the other UART is on a pin header).

Do you have any suggestions as to where to look and also what needs to be done? I've noticed that the interrupt handler isn't complete and so are the time / timer drivers which the framework documentation says are required to get the basics running, have there been any updates to your code?

Many thanks and hopefully sometime soon I can get on with having a go at developing the rest of the drivers (most likely with some help).

Dan

Read the full discussion online.

To add a post to this discussion, reply to this email (S3C2440mfport@discussions.codeplex.com)

To start a new discussion for this project, email S3C2440mfport@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 8:34 AM

Hi Matti,

I'll try your suggestions this weekend and let you know what I come up with. I currently build using either the msbuild command from the command prompt or use pkstudio which is a tool two Russians built which is a GUI front end for the build process. It's very useful and so far has provided decent builds. However I havent tried from Eclipse so I'll give that a go.

Many Thanks,

Dan

Feb 22, 2012 at 2:12 PM

Hi Matti,

Well rather than just jump straight into eclipse which is just an ide I've decided to stay with PKStudio for the moment. I've made a few changes so I can locate the fault and so far I've found that the CPU_EnableMMU method is where it all falls over. I must admit I wasn't expecting any assembly language in here so I'll have to go digging around some more to find out why it's crashing at this point... Thanks for your help so far, hopefully soon I can get the basics up and running :)

Regards,

Dan

Coordinator
Feb 22, 2012 at 7:56 PM

Ok. Have you tried to print out values of c_Bootstrap_SDRAM_Begin, c_Bootstrap_SDRAM_End, c_Bootstrap_FLASH_Begin, c_Bootstrap_FLASH_End and c_Bootstrap_BaseOfTTBs from file S3C2440_Bootstrap.cpp? Maybe CPU_EnableMMU crashes, because address mappings are wrong?