Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Wed Feb 15, 2012 1:57 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
The phrase means that RomBOOT has come up using the primary crystal, and then loaded and run the AT91BootStrap code. The system is clearly running adequately to read NAND to get to that comment in the code.

However, at the moment you have no idea if that is actually the case, because you have no output. You'd need to build the code using the CFG_DEBUG define, to get some text output. The problem here is that GCC will probably build a version of the boot strap that is too big for the 9260's SRAM.

uBoot does not appear to be loading and running, if it where you'd see some text output. When writing this to NAND have you confirmed that it verifies properly?

One potential problem you might have with AT91BootStrap is that the NAND part you are using is not in the nand_id.h file, you'd need to read the datasheet and manual confirm the right codes are in the NandFlash_InitInfo[] structure.

Personally I'd step through the boot with my JTAG debugger, and enable the serial port output.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Wed Feb 15, 2012 8:48 am 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Thank you.
When SAM-BA detect and initialized the NAND Flash, Why I need to confirm the content of it?
I haven't any idea for my problem.
Only I know the problem is in the bootstrap.

I don't get my answer, sorry.
Do need any code available in the following lines in the boot strap?

Quote:
/* At this stage the main oscillator is supposed to be enabled
* PCK = MCK = MOSC */

No code is available here.
I put the hw_init() function here. Please see and if I change it inform me.

Code:
void hw_init(void)
{
   unsigned int cp15;
   
   /* Configure PIOs */
   const struct pio_desc hw_pio[] = {
#ifdef CFG_DEBUG
      {"RXD", AT91C_PIN_PB(14), 0, PIO_DEFAULT, PIO_PERIPH_A},
      {"TXD", AT91C_PIN_PB(15), 0, PIO_DEFAULT, PIO_PERIPH_A},
#endif
      {(char *) 0, 0, 0, PIO_DEFAULT, PIO_PERIPH_A},
   };

   /* Disable watchdog */
   writel(AT91C_WDTC_WDDIS, AT91C_BASE_WDTC + WDTC_WDMR);

   /* At this stage the main oscillator is supposed to be enabled
    * PCK = MCK = MOSC */

   /* Configure PLLA = MOSC * (PLL_MULA + 1) / PLL_DIVA */
   pmc_cfg_plla(PLLA_SETTINGS, PLL_LOCK_TIMEOUT);

   /* PCK = PLLA = 2 * MCK */
   pmc_cfg_mck(MCKR_SETTINGS, PLL_LOCK_TIMEOUT);
   /* Switch MCK on PLLA output */
   pmc_cfg_mck(MCKR_CSS_SETTINGS, PLL_LOCK_TIMEOUT);

   /* Configure PLLB */
   pmc_cfg_pllb(PLLB_SETTINGS, PLL_LOCK_TIMEOUT);

   /* Configure CP15 */
   cp15 = get_cp15();
   cp15 |= I_CACHE;
   set_cp15(cp15);

   /* Configure the PIO controller */
   pio_setup(hw_pio);

   /* Configure the EBI Slave Slot Cycle to 64 */
   writel( (readl((AT91C_BASE_MATRIX + MATRIX_SCFG3)) & ~0xFF) | 0x40, (AT91C_BASE_MATRIX + MATRIX_SCFG3));

#ifdef CFG_DEBUG
   /* Enable Debug messages on the DBGU */
   dbg_init(BAUDRATE(MASTER_CLOCK, 115200));

   dbg_print("Start AT91Bootstrap...\n\r");
#endif /* CFG_DEBUG */

#ifdef CFG_SDRAM
   /* Initialize the matrix */
   writel(readl(AT91C_BASE_CCFG + CCFG_EBICSA) | AT91C_EBI_CS1A_SDRAMC, AT91C_BASE_CCFG + CCFG_EBICSA);

   /* Configure SDRAM Controller */
   sdram_init(   AT91C_SDRAMC_NC_9  |
            AT91C_SDRAMC_NR_13 |
            AT91C_SDRAMC_CAS_2 |
            AT91C_SDRAMC_NB_4_BANKS |
            AT91C_SDRAMC_DBW_32_BITS |
            AT91C_SDRAMC_TWR_2 |
            AT91C_SDRAMC_TRC_7 |
            AT91C_SDRAMC_TRP_2 |
            AT91C_SDRAMC_TRCD_2 |
            AT91C_SDRAMC_TRAS_5 |
            AT91C_SDRAMC_TXSR_8,      /* Control Register */
            (MASTER_CLOCK * 7)/1000000,   /* Refresh Timer Register */
            AT91C_SDRAMC_MD_SDRAM);      /* SDRAM (no low power)   */


#endif /* CFG_SDRAM */
}


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Thu Feb 16, 2012 4:12 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
Please re-read the previous post.

You'd use SAM-BA to verify or read-out the NAND to confirm it is actually working properly. It is a basic sanity check when trying to determine why system are not working, and what bits are.

The AT91BootStrap code is written using the "Send Boot File", the uBoot code is written to 0x20000 within the NAND.

Re-read the linux4sam documentation.

Consider getting a debugger out to determine what's going on, or find a colleague familiar with bring up hardware to assist you. Without doing some more diagnostic testing you really have no idea what the hardware is actually doing.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Thu Feb 16, 2012 7:50 am 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Thank you,
Finally I could boot a linux on my board, But I have a funny problem.
After uploading files to the board. If disconnect the power, and select the Nand Recovery Key and connect the power while BMS=1, the linux will boot up in my board.
I don't know why this problem occured.
Note that I changed the tcl file for samba:
Code:
lappend u_boot_variables \
    "ethaddr=3a:1f:34:08:54:54" \
    "bootdelay=3" \
    "baudrate=115200" \
    "stdin=serial" \
    "stdout=serial" \
    "stderr=serial" \
    "bootargs=mem=64M console=ttyS0,115200 mtdparts=atmel_nand:4M(bootstrap/uboot/kernel)ro,60M(rootfs),-(data) root=/dev/mtdblock1 rw rootfstype=jffs2" \
    "bootcmd=nand read.jffs2 $kernelLoadAddr $kernelUbootAddr $kernelSize; bootm $kernelLoadAddr"


In this state I could boot the linux, but I should BMS=1 and hold the NandRecoveryKey.
Do you have any Idea?


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Thu Feb 16, 2012 3:09 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
Nand Recovery Key, how's that wired up?

The 9260-EK has a BP4 which is a press to ground, code in AT91BootStrap sets up and detects if the button is pressed. It checks for zero, do you have the polarity reversed? or use a different pin?


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Fri Feb 17, 2012 3:56 pm 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
I'm soryy.
I haven't enough experience with customizing the ARM-Board.
I tested other state with my board. I should modify last post.
Note that I upload the original build root zip file from at91(boot,rfs,kernel,tcl and...) the nand flash.When the BMS jumper is connected I couldn't see any data and linux does not boot up. But I remove the jumper the linux boot up on my board. Note that also when I remove BMS jumper I can upload files with samba.
I'm confused, because when BMS=1 should boot from ROM and when BMS=0 should boot from nand flash.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Fri Feb 17, 2012 7:58 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
No, BMS=0 boots from NOR FLASH, which you probably don't have.

BMS=1 boots to RomBOOT, which loads and runs your AT91BootStrap code from NAND into SRAM


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Sat Feb 18, 2012 7:21 am 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Ok, So I have a question plz.
What is the default state for BMS for boot up linux from NandFlash? (BMS=1 or BMS=0)

and What is the state for BMS if I want to work with SAMBA for uploading files to the nand flash? (BMS=0 or BMS=1)

Thank you


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Sat Feb 18, 2012 4:29 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
Both expect BMS=1, the host side code supporting serial/usb SAM-BA is in the same ROM as the code that searches through the boot devices to find bootable code. Please refer to the manual coverage of the boot process. I realize some of this is new, but digesting these documents is pretty critical to the process.

http://www.atmel.com/Images/6221s.pdf
http://www.atmel.com/Images/doc6221.pdf

This does however cause a potential problem if you have broken code in NAND FLASH, and why a) you'd want a jumper to break the CS (chip select) to the NAND, and b) want an erase button (BP4) to be recognized in AT91BootStrap to act as a recovery method.

Before the board boots into Linux, you can use the JTAG (SAM-ICE, J-LINK) connectivity to attach SAM-BA.

BMS=0 is designed to allow you to add an external NOR FLASH (parallel) to replace the boot ROM, doing so is more complicated as it requires a through understanding of the ARM9 boot, 9260 initialization process.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Sat Feb 18, 2012 9:08 pm 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
very very thank you.
Your posts is very useful for me. Thank you again for your attention.
I understand now. I had misunderstanding.
Now, I could upload files to the NAND Flash, but when booting I have error.
My errors are in the following lines:
Code:
U-Boot 1.3.4 (Mar  9 2010 - 19:29:50)

DRAM:  64 MB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   macb0
macb0: Starting autonegotiation...
macb0: Autonegotiation timed out (status=0x7849)
macb0: link down (status: 0x7849)
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x200000, size 0x12d5d0

Reading data from 0x32d000 -- 100% complete.
 1234384 bytes read: OK
## Booting kernel from Legacy Image at 22200000 ...
   Image Name:   Linux-2.6.34
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1234320 Bytes =  1.2 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.34 (root@hamzeh-vm) (gcc version 4.2.0 20070413 (prerelease) (CodeSourcery Sourcery G++ Lite 2007q1-10)) #1 Sat Feb 18 16:38:37 IRST 2012
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9260-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: mem=64M console=ttyS0,115200 mtdparts=atmel_nand:4M(bootstrap/uboot/kernel)ro,60M(rootfs),-(data) root=/dev/mtdblock1 rw rootfstype=jffs2
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 62396k/62396k available, 3140k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc4800000 - 0xfee00000   ( 934 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0023000   ( 108 kB)
      .text : 0xc0023000 - 0xc0252000   (2236 kB)
      .data : 0xc0252000 - 0xc026a720   (  98 kB)
* RCU implementation.
RCU-based detection of stalled CPUs is enabled.
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 98.91 BogoMIPS (lpj=494592)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource pit
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
msgmni has been set to 121
io scheduler noop registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
brd: module loaded
ssc ssc.0: Atmel SSC device at 0xc4828000 (irq 14)
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (3a:1f:34:08:54:54)
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:00, irq=-1)
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mice: PS/2 mouse device common for all mice
rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0
IRQ 1/rtc0: IRQF_DISABLED is not guaranteed on shared IRQs
rtc-at91sam9 at91_rtt.0: rtc0: SET TIME!
i2c /dev entries driver
i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
AT91SAM9 Watchdog: sorry, watchdog is disabled
at91_wdt: probe of at91_wdt failed with error -5
TCP cubic registered
NET: Registered protocol family 17
rtc-at91sam9 at91_rtt.0: hctosys: unable to read the hardware clock
VFS: Cannot open root device "mtdblock1" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Backtrace:
[<c0026ef0>] (dump_backtrace+0x0/0x10c) from [<c0027030>] (dump_stack+0x18/0x1c)
 r6:c0020a08 r5:c3c53006 r4:c026aba4
[<c0027018>] (dump_stack+0x0/0x1c) from [<c003a3ac>] (panic+0x4c/0xd0)
[<c003a360>] (panic+0x0/0xd0) from [<c0009118>] (mount_block_root+0x254/0x2a4)
 r3:00000000 r2:c3c3c5ec r1:c3c19f60 r0:c021d64c
[<c0008ec4>] (mount_block_root+0x0/0x2a4) from [<c00091bc>] (mount_root+0x54/0x6c)
[<c0009168>] (mount_root+0x0/0x6c) from [<c000933c>] (prepare_namespace+0x168/0x1bc)
 r5:c0020a08 r4:c026a954
[<c00091d4>] (prepare_namespace+0x0/0x1bc) from [<c0008954>] (kernel_init+0x100/0x138)
 r5:c001ff78 r4:c026a720
[<c0008854>] (kernel_init+0x0/0x138) from [<c003d1d4>] (do_exit+0x0/0x5b8)
 r5:00000000 r4:00000000
INFO: RCU detected CPU 0 stall (t=1000 jiffies)
INFO: RCU detected CPU 0 stall (t=4000 jiffies)
INFO: RCU detected CPU 0 stall (t=7000 jiffies)
INFO: RCU detected CPU 0 stall (t=10000 jiffies)


Can you help me about this error?Please.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 21, 2012 7:56 am 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Yes, My problem was solved with serial console. So I don't ask other question in this topic. Thank you from CptTitanic.
Your post is very useful for me.
I ask my other question in the other topic.
Thank you. :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: