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 1, 2  Next
Author Message
 Post subject: Serial console not worked after uploading ...
PostPosted: Sun Feb 12, 2012 7:21 pm 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Hi to all,
I could upload the bootloader, kernel and RFS to the NAND FLASH.(AT91SAM9260)
But after reset the board, I couldn't get any data on the debug port and serial console don't working.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Mon Feb 13, 2012 5:04 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
AT91BootStrap won't output anything, unless the debug output was enabled at compile time. Chance are however that the you don't have space in the SRAM on the 9260 for this to work.

uBoot should output diagnostic messages if it runs, if it is not, then you'll need to look at the code you are generating, and where you are putting it in the NAND.

What kind of debugging tools do you have at your disposal, and how much experience do you have with bringing up hardware?


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Mon Feb 13, 2012 7:49 am 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Thank you for your attention and your reply.
I worked with CW9G20 and Mini2440.
But now I make a custom board for AT91SAM9260.
First of all I had to change the bus width in a tcl file in sam-ba for initializing the ram.
After it, I could upload files to the NAND flash.
I see RomBoot in debug port when I want to work with SAM-BA (BMS=1).
In this state I use the ATMEL package (bootstrap, bootloader, kernel, RFS) and a tcl and a batch file for uploading the files in to the NAND Flash and it was successfully done.
But after reset the board (BMS=0) I don't see any data on the debug port.
I want to access the Linux with this port but I couldn't.
Should modify any code in bootloader or bootstrap? for oscillator or any thing?


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Mon Feb 13, 2012 2:40 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
You're going to have to address the SDRAM change and setup in your AT91BootStrap code.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Mon Feb 13, 2012 2:52 pm 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Thank you for your answer.
Can you give me more information about this? I don't know how can I change and setup the SDRAM address and why? PLZ...


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Mon Feb 13, 2012 4:59 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
The AT91BootStrap package handles the initialization of the SDRAM, you'll need to set it up as 16-bit wide, as you mentioned dumping one of the chips. You'll also need to review the timing parameters of the SDRAM chip if it is different, and row, column, bank geometries. Review the source for the 9260-EK board.

If your clocking scheme is different you'll need to review the PLL settings, and rate the CPU and memory/peripherals are running at.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Mon Feb 13, 2012 9:53 pm 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
i'm sorry. I'm begginner in embedded linux with my custom board.

I downloaded bootstrap source from atmel website.
In the sources I found three files.
at91sam9260.c
at91sam9260.h
at91sam9260_inc.h

I found a definition for bus width when we call the sdram_init.
but i don't know that should be change the col,row,timing,pll and etc or no.
why i should change these values?why sam-ba couldn't initialize the ram with 32bits bus width?
I'm confused that why i should modify the codes while my board is very similar to at91sam9260-ek and pinout and devices are similar to these board?
I'm confused


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 1:20 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
Look, I know next to nothing about your design, the row, column, bank and timing setting will need to come from a review of the data sheet of your chosen SDRAM device. If it is an identical part to the 32MB chip used on the 9260-EK, then yes, you'll probably only need to change the width in sdram_init(), and remove the code in sdramc_hw_init() that was setting up the upper 16-bits of the data bus.

If you haven't changed the 18.432 MHz crystal, you probably won't need to play with the PLL settings. The 9260 isn't technically rated to support 133 MHz SDRAM speed, as I recall, so probably not an issue there. But the other SDRAM timing parameters in sdram_init() are in units of the memory clock, so if you fiddle with that, you'll need to adjust them.

Then again, if you only have 32MB of memory, you'll need to revisit where AT91BootStrap loads uBoot, and the compile address for uBoot.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 8:06 am 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
In my board, I used two SDRAM chip (MT48LC16M16A2). This chip was used in at91sam9260-ek too.
The 18.432 MHZ oscillator was used also in my board.
But when I connected the board to pc via USB and run the SAM-BA. The sam-ba send a message that couldn't initialized the RAM.
after searching in the google, I found that if I change the bus width to 16bit, the problem maybe solved.
So, I change the bus width in the tcl file in samba.
Quote:
sam-ba 2.9\applets\isp-project\tcl_lib\at91sam9260-ek

After this modification, the samba could initialized the sdram, and I could upload the files (bootloader,bootstrap,kernel, RFS) to the NAND Flash.
But the serial console not worked after programming.

With these descriptions, Do I change or modify any code in bootstrap?
SDRAM and Xtal in my board and 9260ek are similar to each other.
I see the section in bootstrap codes:

1- I change the AT91C_SDRAMC_DBW_32_BITS to AT91C_SDRAMC_DBW_16_BITS
Code:
   /* 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_16_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)   */

I don't know any modification for col and row in the upper lines?
MT48LC16M16A2 in datasheet:
Quote:
16 Meg x 16 (4 Meg x 16 x 4 banks)
Refresh count = 8k
Row addressing =8K A[12:0]
Bank addressing =4 BA[1:0]
Column addressing =512 A[8:0]

Any other modification needed in codes?

2- I comment the following lines in sdramc_hw_init()
Code:
   writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_ASR(0));
   writel(0xFFFF0000, AT91C_BASE_PIOC + PIO_PDR(0));


3- In the hw_init() is a comment
Code:
   /* At this stage the main oscillator is supposed to be enabled
    * PCK = MCK = MOSC */

Any code should be placed here or no?

4- A compiler switch used in bootstrap with name of "CFG_DEBUG".
I define it in "at91sam9260.h". Is it true?

5- And one question that is remain for me is that why I should change the BusWitdh in tcl file in samba for my board? Is this normal modification? or My hardware has a problem?

Thank you for your attention.
Regards


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 9:15 am 
Offline

Joined: Tue Jun 14, 2011 7:08 am
Posts: 13
Hello Hamzeh ,
I'm an amateur and don't have very experience in practice and hope you help me .
Maybe seem funny , but I recommend you , check your PCB schematic and baud rate .


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 9:20 am 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
I checked the PCB. I'm sure the hardware is ok. But i don't know why I should change the buswidth. A hardware problem or no?
The baudrate is 115200 and I set the terminal at this baudrate.
My question and answers is very important for me in the previous post.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 9:31 am 
Offline

Joined: Tue Jun 14, 2011 7:08 am
Posts: 13
I'm sorry ,
I mean funny is my recommend because I was sure you check them .
I don't think the software terminal has problem , so maybe USART software setting is in correct .


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 2:52 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
Ok, so by choosing 16-bit you are disabling the use of your second SDRAM chip, and reducing the system memory capacity from 64MB to 32MB. This in turn will cause a cascade of problems because uBoot is loaded up at ~63MB within the SDRAM, uBoot is compiled for this high address, and passes a 64MB memory size to the Linux kernel.

You should probably examine your circuit and figure out why the memory isn't working properly.


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 3:15 pm 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
Thank you.
You say that I should use 64MB Ram? I can't use 32MB Ram?


Top
 Profile  
 
 Post subject: Re: Serial console not worked after uploading ...
PostPosted: Tue Feb 14, 2012 9:25 pm 
Offline

Joined: Sun Dec 25, 2011 2:00 pm
Posts: 58
wow, Finally my problem with SDRAM chip was solved. One of the chips don't recognized. The problem was in soldering.
Now I have 2 SDRAM chips with 32 bit bus width.
I could upload the files (bootloader, bootstrap and ...) to the NAND FLash, but after reset the board, the serial port don't work. I don't see any data in serial console.
I use the build root package that released in the at91.com, Do I should change any thing?
I'm sure that RAM is ok. NAND Flash is ok. Serial port is ok. and at91sam9260 is ok. So I'm confused.

I have one question. In the bootstrap codes, a Phrase is available.
Code:
   /* At this stage the main oscillator is supposed to be enabled
    * PCK = MCK = MOSC */

and no code is available here.
Should I set any register or any modification here?
I think the PLL isn't work. Is it possible when the NAND Flash, Ram and serial port are working correctly?
Please help me. I'm confused and I haven't any solution.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 0 guests


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: