From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Porting to ARM LM3S811, Elemental IO PWM issues

Solved!
Go to solution
Hi all,

Ok, so very quickly I resume what I have done:


- The LM3S811: http://www.luminarymicro.com/products/ekk-lm3s811_evaluation_kit.html


- I used the LM3Sxxxx Generic template to create one for
the LM3S811 as instructed in the porting guide for other ARM controllers using
Labview for ARM module, the simple guide.


- I got to compile a test application and run it
successfully on my new target.


- I then used the Elemental I/O wizard to create the
necessary files based again on the LM3S8962 in the generic folder of LM3Sxxxx.
Both boards share almost all the same IOs, I only changed the PWM 0 and 1 to
use port D instead of B, PWMs 2 to 5 share the same ports, so I didn t changed
them.


- I tested some of the AIOs the GPIOs, and I even got the
OLED display driver from luminary to work.


Now, if I use PWM 2 to 5 they work fine, but if I use 0
or 1, my application will freeze as soon as the Elemental IO node is called in
my program when running on the target.


Am I missing something?


Thx


Lukasz

0 Kudos
Message 1 of 10
(9,768 Views)

I just posting this to the Rudkus for ARM

 

Add the define PART_LM3S811 in your build specification (the advanced compiling options page).

 

All the silicon is header files are:

C:\Program Files\National Instruments\LabVIEW 2009\Targets\Keil\Embedded\RealView\EK-LM3S8962\lib\eio

 

 

In summary, when you port:

1) set-up KEIL tools so that memory, etc is setup

2) tell LV ARM about the pin_outs

0 Kudos
Message 2 of 10
(9,738 Views)

Hi greg,

 

I added PORT_LM3S811 do the preprocessor, and no luck. Still doing the same.

 

What should be the syntax? only  PORT_LM3S811? no ";" ?

Message Edited by L. Andrzejewski on 01-11-2010 02:53 PM
0 Kudos
Message 3 of 10
(9,733 Views)
Solution
Accepted by topic author L._Andrzejewski

Ok, found the solution:

 

Edited "LM3S_Pins.c" line34 to : "#define PART_LM3S811"

and "ARM_Serial.c" line 24 to : "#define PART_LM3S811"

 

🙂

 

thx for the hint

0 Kudos
Message 4 of 10
(9,728 Views)
Close LV                                                                     

1. Copy LM3Sxxxx folder and rename the folder to CAN_LUM_Board_LM3811 (Or whatever you wish your target to be called).

    a.    This folder is in: C:\Program Files\National Instruments\LabVIEW 2009\Targets\Keil\Embedded\RealView\Generic

2. Modify TgtSupp.ini

    a.    Change the target name to CAN_LM3S811 (whatever you want)

    b.    Change the description to Luminary Micro CAN_LM3S811 (whatever you want)

        [Target]

        name = CAN_LM3S811

        description = Luminary Micro CAN_LM3S811

        eiodirectory = eio

    To add the new target to your project

    a.    Open LV and add target by right-clicking on your project name and New Targets and Devices menu.

    b.    Select the option "Other".  You will get a new dialog so you can select the target you just added above.
   
3. To target small memory microcontrollers you must use the microRTX operating system(LabVIEW ARM uses the full RTX OS as default).  You will also need to edit a function in the code generation of LabVIEW. This is a global edit, so it also changes all targets.  I found that LabVIEW ARM product seems to still work fine with this global edit on the LM3S8962. In the file headless.c comment out the function exit (0) as shown in line 93.

        C:\Program Files\National Instruments\LabVIEW 2009\CCodeGen\libsrc\os\common

4. The way LV ARM works is that it takes the target template in the folder at: C:\Program Files\National Instruments\LabVIEW 2009\Targets\Keil\Embedded\RealView\Generic\CAN_LUM_Board_LM3S811 and copies it to the folder where you define your LV project and VI’s.  LV ARM and the KIEL tools then edit these new files for your end application.  As such, we need to edit the template file in the main LV folder so it uses the microcontroller you wish selected.  Open the file LabVIEW.Uv2 in the folder C:\Program Files\National Instruments\LabVIEW 2009\Targets\Keil\Embedded\RealView\Generic\CAN_LUM_Board_LM3S811\Template\Pro ject with the KEIL IDE tools

    a.    Select the LM3S811 Microcontroller.
    b.    Xtal= 6Mhz
    c.    Enable micolib to reduce memory needs for such a small part.
    d.    In Debug and Ytilities, change to Use "Luminary Eval Board"


5. Change Heap size to: "Heap    EQU     0x00000200" in "Startup.s" (Not sure but if not using debugging it can be set to zero)
6. Edit "LM3S_Pins.c" line34 to : "#define PART_LM3S811" and "ARM_Serial.c" line 24 to : "#define PART_LM3S811"

In LV

1. Import eio's from the \generic\LM3sxxxx\eio\LM3S8962
    a. Change PWM 0 and 1 to use port D instead of B
2. Disable debugging, not enough RAM for it.

Thx to gregc

Have fun!
Message 5 of 10
(9,724 Views)

I am having problems again, I have corrupted sent data throught serial port 0 when using the NI serial driver. I also get eroor code -1073807339 when reading that same data sent from my ARM to PC inside labview with VISA.

 

I am thinking that the timings might be wrong somehow, but I don t know where to look for since the NI serial driver for ARM dosen t seem to be calling uart.c where the registers and baud-rate divisor is located for UART0. The 3S811 is Xtal 6Mhz, not 8Mhz like the 3S8962.

 

I also tested the PWM on a scope and the frequency dosen t match if i ask for 1kHz I get around 666Hz. Seems like setting the Xtal to 6Mhz in uVision is not enought.

 

 

thx

Lukasz

0 Kudos
Message 6 of 10
(9,675 Views)

Hi Lucasz,

 

There is a KnowledgeBase article on the error that you are getting. It looks like you may have to increase the timeout that is causing this error.

 

Also take a look at page 454 of the LM3S811 manual for information that might be helpful.

 

Regards,

 

Stephen S.

National Instruments
Applications Engineering
0 Kudos
Message 7 of 10
(9,636 Views)

Ok, here is the solution.

 

Open "startup.s"

Goto line 193:

        ; set the system clock to run at 50 MHz
        ; SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL |
        ;                SYSCTL_XTAL_8MHZ | SYSCTL_OSC_MAIN);

        LDR        R0, =0x01C002C0
        BL        SysCtlClockSet

        B       __main

 

Replace R0, with the right values found in "sysctl.h" line 236:

in my case set the crystal to 6Mhz which is "0x000002C0"

 

PWM timing is restored and serial port works fine now.
0 Kudos
Message 8 of 10
(9,604 Views)

Hello, dear L.Andrzejewski:Can you tell me the specific porting progress about the LM3S3811 by using the LM3SXXXX folder?Because I want to port LM3S2110 ARM chip, how can I do with the LM3SXXXX folder without Microprocessor SDK?

Thank you very much!

0 Kudos
Message 9 of 10
(7,514 Views)

Hello, dear L.Andrzejewski:Can you tell me the specific porting progress about the LM3S3811 by using the LM3SXXXX folder?Because I want to port LM3S2110 ARM chip, how can I do with the LM3SXXXX folder without Microprocessor SDK?

 

I don't know how realize this progress:

 

"
5. Change Heap size to: "Heap    EQU     0x00000200" in "Startup.s" (Not sure but if not using debugging it can be set to zero)
6. Edit "LM3S_Pins.c" line34 to : "#define PART_LM3S811" and "ARM_Serial.c" line 24 to : "#define PART_LM3S811"

In LV

1. Import eio's from the \generic\LM3sxxxx\eio\LM3S8962
    a. Change PWM 0 and 1 to use port D instead of B
2. Disable debugging, not enough RAM for it.
"

 

Thank you very much!

 

0 Kudos
Message 10 of 10
(7,511 Views)