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  [ 8 posts ] 
Author Message
 Post subject: Use both can0 and can1 on SAM9x25-ek
PostPosted: Wed Mar 14, 2012 1:32 pm 
Offline

Joined: Wed Mar 14, 2012 1:14 pm
Posts: 2
I'm trying to set up my evaluation board (SAM9x25-ek) to use both CAN controllers that are available on the chip.

The connector CAN1 seems to be available as "can0" in linux by default and the CAN0 is not available.

CAN0 is shared with the DBGU-UART and has to be selected by opening the jumper11. This will prevent the normal use of the DBGU.

My question is what effect this will have on the system and the boot procedure (I use the nand boot with at91Bootstrap and u-boot in the same way as the demo-package for linux). Has anyone used this setup with linux?

I assume I have to recompile both at91Bootstrap and uboot to use another UART, but the built in ROM program will still try to use the DBGU.

Can anyone give some hints or directions regarding this?


Top
 Profile  
 
 Post subject: Re: Use both can0 and can1 on SAM9x25-ek
PostPosted: Thu Mar 15, 2012 8:22 am 
Offline

Joined: Wed Feb 29, 2012 11:12 am
Posts: 3
hi...
I'm trying to set up my evaluation board (SAM9x25-ek) too.
Look at the code i attached.
To use USART0 instead of DBGU, I have modified some files (in below) from U-Boot Source

include/configs/at91sam9x5ek.h
arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c:
drivers/serial/atmel_usart.c:
drivers/serial/atmel_usart.h:

also, you have to modify default cosole on linux (/etc/inittab)

i hope it help you...!


Attachments:
atmel_usart.zip [9.38 KiB]
Downloaded 53 times
Top
 Profile  
 
 Post subject: Re: Use both can0 and can1 on SAM9x25-ek
PostPosted: Thu Mar 15, 2012 3:44 pm 
Offline

Joined: Wed Mar 14, 2012 1:14 pm
Posts: 2
Thank you for helping, I will gladly look at your suggestions. Unfortunately when I started to build my own system I ended up in some other errors of more basic nature that I'm currently struggling with.


Top
 Profile  
 
 Post subject: Re: Use both can0 and can1 on SAM9x25-ek
PostPosted: Thu Mar 22, 2012 12:14 am 
Offline

Joined: Wed Mar 21, 2012 11:55 pm
Posts: 3
ryuje001 wrote:
hi...
I'm trying to set up my evaluation board (SAM9x25-ek) too.
Look at the code i attached.
To use USART0 instead of DBGU, I have modified some files (in below) from U-Boot Source

include/configs/at91sam9x5ek.h
arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c:
drivers/serial/atmel_usart.c:
drivers/serial/atmel_usart.h:

also, you have to modify default cosole on linux (/etc/inittab)

i hope it help you...!


Top
 Profile  
 
 Post subject: Re: Use both can0 and can1 on SAM9x25-ek
PostPosted: Thu Mar 22, 2012 12:16 am 
Offline

Joined: Wed Mar 21, 2012 11:55 pm
Posts: 3
Hi ryuje001,

I just read your reply about using UART0 for the U-Boot console.
In my case I want to output the debug messages of AT91Bootstrap and U-Boot to UART0, since the board I have does not route the DBGU signals to a RS232 port. Instead they are routed to a JTAG header using TTL signal levels. So I cannot connect them to a standard serial port. So at the moment I'm not able to see what the board is doing...

I'm able to compile AT91Bootstrap and U-boot as a part of the buildroot build proces. The I tried to initialize UART0 in the AT91Bootstrap application using your code as an example, but I seem not to get it working.

Perhaps you also modified the AT91Bootstrap bootloader. Or maybe you can point me out which registers I need to configure.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Use both can0 and can1 on SAM9x25-ek
PostPosted: Fri Mar 23, 2012 4:16 am 
Offline

Joined: Wed Feb 29, 2012 11:12 am
Posts: 3
hi matthijs

in my case, i have nothing done with bootstrap, i've just modified u-boot source as i attatched. As a result, while bootstrap running, it dumps mesages to DBGU port, after u-boot starts running, it dumps messages to USART0.

anyway, if you want to dump message to USART0 while bootstrap running. i think you should modified several parts.

first, you should enable pins for USART0 TXD, RXD in
<bootstrap source root>/board/at91sam9x5ek/at91sam9x5ek.c

in function hw_init(void)
#ifdef CONFIG_DEBUG
{"RXD", AT91C_PIN_PA(9), 0, PIO_DEFAULT, PIO_PERIPH_A},
{"TXD", AT91C_PIN_PA(10), 0, PIO_DEFAULT, PIO_PERIPH_A},
#endif

==>
#ifdef CONFIG_DEBUG
{"RXD", AT91C_PIN_PA(1), 0, PIO_DEFAULT, PIO_PERIPH_A},
{"TXD", AT91C_PIN_PA(0), 0, PIO_DEFAULT, PIO_PERIPH_A},
#endif

second, you should modify
<bootstrap source root>/driver/dbgu.c
change AT91C_BASE_DBGU => AT91C_BASE_US0 .. and so on
I guess there will be more things to do..

P.S : Atmel recommends Arm-2010q1 for toolchain.

I hope it will help you...
and i am sorry that i am not good at using English.

regards.


Top
 Profile  
 
 Post subject: Re: Use both can0 and can1 on SAM9x25-ek
PostPosted: Fri Jun 15, 2012 8:47 am 
Offline

Joined: Fri Apr 13, 2012 9:09 am
Posts: 5
hakanb wrote:
I'm trying to set up my evaluation board (SAM9x25-ek) to use both CAN controllers that are available on the chip.






I also want to use can controllers,but I don't know how.
In "/dev" I can't find /dev/can,so I don't know how to test the can driver if it is ok.Can you tell me your way.
Thank you!!!!!


Top
 Profile  
 
 Post subject: Re: Use both can0 and can1 on SAM9x25-ek
PostPosted: Tue Nov 20, 2012 6:43 pm 
Offline

Joined: Tue Nov 20, 2012 6:30 pm
Posts: 1
Thank you for your help regarding this problem.
We tried to get this fixed for our version but that leads to other errors
Quote:
at91sam9x5_devices.c: In function 'get_chip_id':
at91sam9x5_devices.c:37: error: 'AT91SAM9X5_BASE_US0' undeclared (first use in this function)
at91sam9x5_devices.c:37: error: (Each undeclared identifier is reported only once
at91sam9x5_devices.c:37: error: for each function it appears in.)
at91sam9x5_devices.c: In function 'get_extension_chip_id':
at91sam9x5_devices.c:42: error: 'AT91SAM9X5_BASE_US0' undeclared (first use in this function)
at91sam9x5_devices.c: In function 'at91_serial3_hw_init':
at91sam9x5_devices.c:101: error: 'AT91SAM9X5_BASE_US0' undeclared (first use in this function)
at91sam9x5_devices.c: In function 'at91_usart0_hw_init':
at91sam9x5_devices.c:134: error: 'AT91SAM9X5_BASE_US0' undeclared (first use in this function)



What u-boot-version did you use? Mine is 2010.06 with a u-boot-5series_1.0.patch


ryuje001 wrote:
hi...
I'm trying to set up my evaluation board (SAM9x25-ek) too.
Look at the code i attached.
To use USART0 instead of DBGU, I have modified some files (in below) from U-Boot Source

include/configs/at91sam9x5ek.h
arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c:
drivers/serial/atmel_usart.c:
drivers/serial/atmel_usart.h:

also, you have to modify default cosole on linux (/etc/inittab)

i hope it help you...!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users 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: