Imx28evk variant, how to do something simple?

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

Imx28evk variant, how to do something simple?

1,272 Views
peteewg
Contributor III

Hi Guys,

We have an imx28 processor board, based around the reference schematics, but with a slightly different pin mapping to fit our application.

I'm a hardware engineer, I can design integrated circuits and pcbs, but now I want to turn my hand to the embedded software side of things. The problem I am facing is where to begin, there is such a vast amount of information out there that it's hard to find a starting point. So I thought I'd ask how to do something simple and see if you guys could point me in right direction (I'm all for RTFM, I just need to know which M), all of this may have been covered in other posts I just wanted to gather it in one place, if this useful for other folk I will tidy it up.

So let's propose a noddy set of tasks for the IMX28EVK:

1) Build a linux distribution,

2) Setup a cross compile toolchain.

3) Add in an SSH server,

4) Add Nano (text editor) to the distro.

5) Access a GPIO VIA sysfs through the command line and switch on/off an LED

6) Access the GPIO using a GPIO driver and write a simple application to flash the LED

7) Set up an interrupt off another GPIO and have the LED change at the bush of a button.

8) Use another pin function (e.g. LRADC).

The Story So Far


1, 2) I followed Daiane's excellent Yocto training :https://community.freescale.com/docs/DOC-94849

        As Well as Otavio's Tutorial : Yocto: Training in English


Good stuff so far:

  3) add in an SSH server (I don't have a serial port),

  I found this magic line to put into my local.conf file (I'm not sure this was the correct way to go about it):

   EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-openssh"


  Source : https://community.freescale.com/thread/309578


3a) BTW a neat little tool for finding out the IP address :Advanced IP Scanner - Free, fast and easy-to-use network scanner


4) This is staring to get tricky,

I tried running "hob", but unfortunately it didn't like imx28 (I think it might have been the line I inserted for #3), so I couldn't get a package list, also it went ahead and edited my local.conf and bb.conf files so that I couldn't bitbake any more.

  After a bit of messing about I got back to it working again.


This is probably a good time to point out that if you do:

"source setup-environment build" and there is a build folder with conf files already it skips setting up the path variables, you can fix this by doing:

  "source setup-environment build_temp" then deleting build_temp.

  Don't do what I did first which was sudo apt-get install bitbake (I think it is the wrong version of bitbake that gets installed and the recipes don't bake correctly).


So back to #4 if you run hob with a clean local.conf file you can see all the packages, but for some reason a build didn't complete for me so I did:

IMAGE_INSTALL += " \

   nano"

From:

https://community.freescale.com/docs/DOC-94967

I picked the GCC compiler from the list and added it in.

Great, so now I can write and compile code on my device accessed via an SSH.

5) Let's try and turn on LED 3 (GPIO3_5), Led 2 is already flashing away.

echo 101 > /sys/class/gpio/export

device or resource is busy

Now I'm stumped,

I Found this: https://community.freescale.com/thread/309043

And actually what I think I want to be able to do is define a brand new dts (eventually I want to run on my own hardware),

it doesn't seem right to edit the one in build/tmp/.....

So any tips on tasks 5-8 ?

Also how do I stop LED2 flashing away? on my custom hardware I don't have LED2?

Pete




0 Kudos
6 Replies

705 Views
peteewg
Contributor III

Thanks for your help Yuri, that gets me another step forward...

Okay so my initial mistake was that LED3 -> GPIO100

not GPIO101 which is the heartbeat LED.

So follow up questions:

1) Can I use other HW pin functions (PWM, SPI etc) through sysfs?

2) Where is the Heartbeat function defined/called and how do I disable it?

     (I've had a look through the scripts in the init.d directory I can't see any reference to it).

3) How can I read the voltages from the LRADC pins?

4) If I wanted to write some c-code to do this, do I use the header files here :

       build/tmp/sysroots/imx28evk/usr/src/kernel/arch/arm/mach-mx28

Any pointers on getting this working in the first instance?

5) will I need to update the .dts for our new hardware ?

          build/tmp/sysroots/imx28evk/usr/src/kernel/arch/arm/boot/dts/my_board.dts

This doesn't seem right as we are in a temporary working directory (and it's labelled imx28evk, which it isn't any more)

0 Kudos

705 Views
YixingKong
Senior Contributor IV

Peter

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 Kudos

705 Views
YixingKong
Senior Contributor IV

Peter

Have your questions got answered, or created another discussion for your unansweed questions?

Regards,

Yixing

0 Kudos

705 Views
Yuri
NXP Employee
NXP Employee

I think it makes sense to create separate threads in Community for the Your questions above.

0 Kudos

705 Views
davee
Contributor III

For the Yocto related questions you would would get a faster more accurate response from using the IRC channel #yocto on freenode.

Best regards

Dave

0 Kudos

705 Views
Yuri
NXP Employee
NXP Employee

Please check that the pins you will try to use are really accessible as GPIO pins and were not requested by the kernel

(gpio_request). If pin was gpio_request'ed, you will need to gpio_export the same pin inside the kernel in order to

have it accessible through SYSFS. If pin is not set as GPIO by default, you will need to set IO MUX in the proper

file inside <kernel>/arch/arm/mach-XXX. For i.MX28 EVK this is


<ltib_dir>/rpm/BUILD/linux/arch/arm/mach-mx28/mx28evk_pins.c


Please refer to the following threads :

https://community.freescale.com/message/365311#365311


https://community.freescale.com/message/366654#366654