How to compile a simple "Hello world" program for FRDM-LS1012A board using CodeWarrior?

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

How to compile a simple "Hello world" program for FRDM-LS1012A board using CodeWarrior?

1,668 Views
alenagrigorieva
Contributor II

I have FRDM-LS1012A board. I ddin't change/update anything on it, it has configuration as delivered. I downloaded latest version of CodeWarrior for ARMv8 and tried to create a simple "Hello world" program.  All sample programs do compile, but don't execute on my board. I get "exec format error". When I looked at preferences I saw that target processor is Cortex-M3, and it can't be changed. Then I tried to create a new project. There is a possibility to choose a target processor, but there is no Cortex-A53 in the drop-down list. What should I do?

I work on Windows 7. 

0 Kudos
3 Replies

1,155 Views
Pavel
NXP Employee
NXP Employee

If you want to run your example under Linux, use Linux Apllication Debug project or SDK toolchain.

Your Bare board project can be using under Linux.

This project contains memory initialization code and will not work under Linux.

Look at the Section 2.3.2 of the ARMv8_Targeting_Manual.pdf file. This file is available using the following path in CodeWarrior folder:

C:\Freescale\CW4NET_v2016.01\CW_ARMv8\ARMv8\Help\PDF

 

Use .o file for loading if this project is used.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,155 Views
alenagrigorieva
Contributor II

Hello!

Sample Linux programs don’t execute either.

Hello C sample program, Debug version gives the following error message:

root@ls1012afrdm:~# exec ./hellol.elf

hellol.elf[1503]: unhandled level 2 translation fault (11) at 0x0

0000008, esr 0x92000006

pgd = ffff80000edb6000

*pgd=00000000981db003, *pud=00000000916c7003, *pmd=000

0000000000000

CPU: 0 PID: 1503 Comm: hellol.elf Tainted: G C 4.1.8

-g4b2f599 #1

Hardware name: LS1012A FREEDOM Board (DT)

task: ffff8000180b8c80 ti: ffff80000fccc000 task.ti: ffff80000fcc

c000

PC is at 0xffff7895c5d0

LR is at 0xffff789537a0

pc : [<0000ffff7895c5d0>] lr : [<0000ffff789537a0>] pstate: 60000

000

sp : 0000fffff48f1980

x29: 0000fffff48f19c0 x28: 0000ffff7897c000

x27: 0000000000000001 x26: 0000ffff7897d000

x25: 0000000000000000 x24: 0000ffff78968110

x23: 0000ffff7897e190 x22: 0000000000410658

x21: 0000ffff7897e190 x20: 0000fffff48f1980

x19: 0000ffff7897e190 x18: 0000000000000000

x17: 0000ffff78965074 x16: 0000ffff7897d000

x15: 0000000000000000 x14: 0000ffff78964abc

x13: 0000000000400000 x12: 0000000000000002

x11: 0000000000000006 x10: 7f7f7f7f7f7f7f7f

x9 : feff38322d352d31 x8 : 0000000000000030

x7 : 0000000000000009 x6 : 0000000000000020

x5 : 0000000000000002 x4 : 0000fffff48f19c0

x3 : 0000fffff48f1998 x2 : 0000fffff48f1980

x1 : 0000000000000001 x0 : 0000000000000000

If I try to execute main.o from Debug/src I get “-sh: ./main.o: cannot execute binary file: Exec format error”

If I try Release version, I get “-sh: ./hellol.elf: cannot execute binary file: Exec format error” or “-sh: ./main.o: cannot execute binary file: Exec format error”

Your SDK doesn’t support Cygwin. When I try to execute ./sources/meta-freescale/scripts/host-prepare.sh I get error message “Error: Unsupported Distribution, Exit”

>Your Bare board project can be using under Linux.

>This project contains memory initialization code and will not work under Linux.

I assume you wanted to say “Bare board project can NOT be used under Linux”

Any more ideas? How can I compile a simple application?

Alena Grigorieva

OOO NPP “Ekra”

С уважением, Григорьева Алена Вадимовна,

инженер-программист отдела перспективных разработок Э1,

ООО НПП "ЭКРА"

тел.(8352)220110 доб.1561

grigorieva_a@ekra.ru

0 Kudos

1,155 Views
alenagrigorieva
Contributor II

It turned out to be a problem with ftp mode(text/binary) of ftpserver.

0 Kudos