Min startup code for imx6?

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

Min startup code for imx6?

Jump to solution
5,424 Views
johnballance
Contributor III

Hi. I'm working on a custom -non-linux- imx6 solution. Can anyone point me to the minimum register writes etc to get a simple uart up? I understand, I think, the IVT and DCD stuff, and I believe I ought to be able to put all I need in that area for proof of concept... Any help appreciated.. Thanks

Labels (1)
0 Kudos
1 Solution
2,065 Views
Yuri
NXP Employee
NXP Employee

Please take a look at thread activities again - it contains file "uart1_led.7z.zip"

View solution in original post

0 Kudos
16 Replies
2,065 Views
Yuri
NXP Employee
NXP Employee

Please apply to the Platform SDK.

Chapter 33 (Configuring the UART Driver) of "iMX6_Firmware_Guide.pdf" in documentation provides detailed

descriptions of UART configiring.

https://www.freescale.com/webapp/Download?colCode=i.MX6_PLATFORM_SDK&location=null&fsrch=1&sr=1&Pare...

2,065 Views
johnballance
Contributor III

Hi.. I have seen that document. It goes a long way. I think it is the clock sourcing I'm getting lost in. What is the clock input to the uart block (MHz)?.. does that need enabling after my code had been entered, or should the imx6 internal boot rom have set that going? ..(my code is the first code encountered.. it sits where something like uboot would sit, so I cannot rely on most of the normal assumptions about setup...)

What I need to get to is a really minimal sdcard image that outputs a serial character (to prove I can, hence keep sane) before any other initialisation (e.g. mmu setup etc) is done.

Your reply appreciated, thanks

0 Kudos
2,064 Views
Yuri
NXP Employee
NXP Employee

You may look at the enclosed simple example. Hope it helps.

2,064 Views
sarasur
Contributor II

Hello Yuri,

I built the given uart0_led example using "gcc-arm-none-eabi-4_9-2015q3-20150921-win32 GCC ARM Embedded project files : GCC ARM Embedded " toolchain (however not the Sourcery g++ Lite which you have used as seen in test.map ). Sourcery g++ Lite is now Mentor Graphics product which is available for 30 days evaluation only. So dropped an idea of using it for future developments

The problem now I face is in the makefile. Please check in the attached .jpeg file which shows an error relating make***[] error 1.

I am using GNU ARM Eclipse Build Tool for make. GNU ARM Eclipse - Browse /Build Tools at SourceForge.net

May I please know where am I going wrong.

Thanks and regards,

Sarang

makefile_error.jpg

0 Kudos
2,064 Views
Yuri
NXP Employee
NXP Employee

Hi,

The makefile in my package may be not needed for Eclipse.

It is intended to build the image under command line (CMD).

Also, You may look at

Integrating Processor Expert for i.MX and ARM GCC with Eclipse

Regards,

Yuri.

0 Kudos
2,064 Views
sarasur
Contributor II

Hi,

I deleted makefile of your sample example then build it. Eclipse generated its own makefile. Still I get the same error. Any solution to this problem?

I have followed the steps at Integrating Processor Expert for i.MX and ARM GCC with Eclipse to get eclipse up and running for iMX6DL bare metal LED flicker. I have even build the sample  sources.7z.zip at that link but it too gives an error for the makefile (after letting Eclipse to create its own makefile)

I have attached .jpg to show the errors thrown. First image shows Makefile error in uart1_led    and Second image shows Makefile error in sample at Integrating Processor Expert for i.MX and ARM GCC with Eclipse  ( -lcs3 and -lcs3arm error may be due to Sourcery Codebench toolchain used by the author but I have used GCC ARM toolchain GCC ARM Embedded project files : GCC ARM Embedded )

Any solution to this error of makefile???

Regards,

Sarang

makefile_error_combined.jpg

0 Kudos
2,064 Views
sarasur
Contributor II

Hi,

After reading GNU ARM Eclipse / Support requests / #30 Trying to compile with arm-none-eabi-g++    and   Help for building or using GCC , it seems that the error is in the Linker Script (mx6dq.ld file).

But still the mystery of error continues. I am using ARM GCC version 4.9.3

Regards,

Sarang

0 Kudos
2,064 Views
Yuri
NXP Employee
NXP Employee

Hi,

There is the article of Miro Samek, which is very helpful in clarifying of startup code
and linker script. Please refer to “Building Bare-Metal ARM Systems with GNU”.

http://www.embedded.com/design/mcus-processors-and-socs/4007119/Building-Bare-Metal-ARM-Systems-with...

You may try the simplest linker file (for OCRAM) as following :

SECTIONS

{

. = 0x00920000;

.text : { *(.text) }

.data : { *(.data) }

.bss : { *(.bss) }

}

Please refer to section 3.3 (Simple Linker Script Example) of “ld.pdf” in toolchain

documentation for more details.

Regards,

Yuri.

0 Kudos
2,064 Views
sarasur
Contributor II

Thank you Yuri for your replies.

I figured out the solution to the error: Undefined reference to '_exit'. After reading http://stackoverflow.com/questions/19419782/exit-c-text0x18-undefined-reference-to-exit-when-using-a...  I had to add --specs=nosys.specs command in eclipse as shown in the figure.

Resolution_error1.jpg

Regards,

Sarang

0 Kudos
2,064 Views
Yuri
NXP Employee
NXP Employee

Hi,

  Also, You may write own (minimal) syscalls lib. Please refer to
Chapter 12 (System Calls) of "libc.pdf" in toolchain documentation.

Regards,

Yuri.

0 Kudos
2,064 Views
phdm
Contributor III

Is that program (uart_led/test.bin) compiled for a i.MX6 ?  It does not have the format (ivt + boot data + dcd + application) of a i.MX6 Boot Rom Program Image, and it is linked to be loaded at 0x900000 which is a reserved address in the i.MX6.  It is supposed to work on a i.MX6 ?

0 Kudos
2,064 Views
Yuri
NXP Employee
NXP Employee

Yes, the led example is intended for JTAG load (to internal RAM), no IVT there.
As for IVT, please use U-boot  

0 Kudos
2,064 Views
johnballance
Contributor III

Hi

The code as provided I did recompile, because I was also using a non GPL

build environment, BUT, it does show all that is needed to get a serial

port running. As such it proved invaluable!

John

Stop press! Just announced -

Free Standard Broadband for 6 months, unlimited data, and no minimum

contract

For full details of see http://www.JustAskJB.co.uk

<http://www.justaskjb.co.uk>

Intrigued? Call me

John Ballance C.Eng MIET - jwb@rosery.net - 07976 295923

0 Kudos
2,065 Views
johnballance
Contributor III

sample.. where please?

0 Kudos
2,066 Views
Yuri
NXP Employee
NXP Employee

Please take a look at thread activities again - it contains file "uart1_led.7z.zip"

0 Kudos
2,065 Views
johnballance
Contributor III

Thanks Yuri

That is brilliant.. I hadn't realised there was another way to view the thread.. when I found that, I found your reply. A lovely thing to wake up to!

0 Kudos