UART on P4080 : URGENT HELP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UART on P4080 : URGENT HELP

Jump to solution
1,184 Views
sumanthmushiger
Contributor III

Hello All,

 

I have got this attached UART driver for P4080.  Using Cmake -gcc I have complied it and loaded into the machine, but its not working for me. The Lauterbach Trace 32 connected to it says :" target reset", as soon as I press RUN.

 

If I remove/comment this thing, it runs smoothly.

 

Experts please check the driver and tell me, where am I going wrong? I have been trying to debug it since 3 days with no fruit.

I guess its some where in clock initializing or its because I don't see any (RCW[UART]) config here.

 

Or else, if there is any other  simple working driver with you, please can you share it with me ? I need to send char data to uart port, which is connected to minicom.

Or else you can atleast tell me the steps to initialize the minimum port P4080 uart to send char data to minicom connected to uart1.

 

By using U-boot, I am able to connect to P4080 com port using minicom. Its tested and works perfectly.

 

Sincerely waiting for help,

 

Sam

Original Attachment has been moved to: P4080DS_eabi_serial.zip

0 Kudos
1 Solution
825 Views
marius_grigoras
NXP Employee
NXP Employee

You need to have the RCW and PIXIS parts. I'm assuming that you already have a good RCW on the board (because the u-boot is working as expected).

Also, the UART driver is based on PIXIS registers for calculating the sysclk. For that we'll need to initialized the PIXIS part using: TLB, LAW and CS (eLBC controller). You can take a look in the u-boot initialize for these  or in the P4080DS_init_core.tcl from CW.

Regards,

Marius

View solution in original post

0 Kudos
5 Replies
825 Views
marius_grigoras
NXP Employee
NXP Employee

Hi,

This project is CW based and it works only together with the stationary CW P4080DS project.

Have some questions:

1. Are you using CW? What version? Have you made a stationary project for P4080DS - Download target? This will add in the project the UART libs by default. We need just to compile the project and run it on the target.

2. What board/SoC versions do you have?

Thank you,

Marius

0 Kudos
825 Views
sumanthmushiger
Contributor III

Hello mariusviorelgrigoras-b32331,

No I am not using CW, my project is about building UART driver for FREERTOS, which is built around P4080DS. Freertos is running perfectly except for uart, because it doesn't have an uart driver.

Well to compile and load, I am using Cmake & U-boot to load the RTOS on to the system.

I am using P4080COME-DS-PB board. Is there any bare metal driver for Uart P4080?

And atleast tell me, which registers are necessary to config UART on P4080.

scottwood Thank you for your reply, The TLB settings seems to be appropriate, because U-Boot's uart communication is happening perfectly, I am not using Pixis to get the system clock, I am directly defining at SYSTEM_CLOCK.

Regards,

Sumanth

0 Kudos
826 Views
marius_grigoras
NXP Employee
NXP Employee

You need to have the RCW and PIXIS parts. I'm assuming that you already have a good RCW on the board (because the u-boot is working as expected).

Also, the UART driver is based on PIXIS registers for calculating the sysclk. For that we'll need to initialized the PIXIS part using: TLB, LAW and CS (eLBC controller). You can take a look in the u-boot initialize for these  or in the P4080DS_init_core.tcl from CW.

Regards,

Marius

0 Kudos
825 Views
sumanthmushiger
Contributor III

Thank you mariusviorelgrigoras-b32331,

I just utitlized all ready dumped code by U-boot.

Its working fine.

Thanks again,

Sam

0 Kudos
825 Views
scottwood
NXP Employee
NXP Employee

What environment are you plugging this driver into?  Are TLBs set up properly for the I/O?  Is a LAW and localbus chipselect set up properly for pixis?  Are exception handlers set up properly to diagnose faults?

Is GetClockDivider() the function that causes things to fail?

BTW, you should not just dereference simple pointers to do I/O.  At the very least use a volatile pointer.  Better would be I/O accessors like those found in U-Boot, Linux, etc.

As for an example driver, one would be in U-Boot itself.  Another is in libos, which you can find at sdk/hypervisor/libos.git - Startup code and library for bare metal software

0 Kudos