W-ARM IDE

stevech:
the LPC21xx and others have an a serial port bootloader installed by NXP. Nice.

I think they do the same for the new Cortex chips too. Freeware called FlashMagic is used with the bootloader.

I use this for field updates and use JTAG (J-Link) for development.

A GUI and aid for setting up the PLL would be really helpful. That was and is a really hard to understand part. I go for max speed and rely on sleep cycles for power conservation.

I will add the flashmagic program selection in the W-ARM IDE. It will be in the next release under the F10 key or in the tools menu. Then it will be a standard feature. :slight_smile:

I think i can use the standard startup.s with some minor adjustments. I am thinking of adding a lowlevel_init_c file for the LPC210x to initialize the pll and powerup requirements. For the linker file i think i know what to do now. I will add the required code during the weekend when i have time again.

A pll calculator will not be difficult but labour intensive because every mcu from different vendors will have different settings. Maybe if more forum members step up , we can make this a joined effort. Then we combine all the information for the different mcu’s in one little tool that can create the necessary standard c -code to initialize the pll and clock correctly. That is easy to do but as mentioned, collecting the formula’s and specifics for each mcu from different vendors will take some time. If we do the collection and sorting together it is easier todo. Because for many different mcu’s i do not have any information.

I have learned that the LPC series from NXP require a checksum at memory address 0x0000 0014. Can flash magic override this or is there another solution for it ? The SAM7S does not require this to function or to use the embedded bootloader.

I think the checksum is calculated by the linker in most tools. I use IAR and GCC.

I don’t recall if flashMagic can recalculate the checksum. If it does, I’ve not needed to do so because the linkers for the tools do the calculation.

Hello Steve.

I have to delay the releasing of the new version a bit. There are some bugs i do not want to leave in, in my example code.

I figured out how to create the linker files for LPC ( Almost exactly the same way as for the SAM7S, i really can use old code for it :slight_smile: ) I have found proper assembler files to use as template files. I am still busy with some functions i really like to add before releasing the third beta. Also, the manual is not as good as i would like it to be.

I think it is really important to present example code that just works and with proper documentation, as such my decision for the delay. My apologies for this to anyone who was hoping on the release.

EDIT:

There are EM waves appearing at the far horizon :).

I solved 3 major issues. :slight_smile:

Now i can continue with the completion of the template files.

Upcoming enhancements/changes/bugfixes for W-ARM 0.92:

For the SAM7S (But software can be ported to LPC series with some small modifications):

9 software timers present for the user with a practical resolution of 1 milliseconds.

There are 11 timers present but timer(10) and Timer(11) are used for some hardware functions.

A function: Timer(Timer ID) returns 0 when time is elapsed and 1 when timer is running.

The timers can be accessed (read write) through a memory pointer directly or a ReqTimer function indirectly.

A printstring function similair to printf and sprintf. It can convert \t, \r, \n. It can convert 1 32 bit unsigned variable to binary , hexadecimal or decimal representation in ascii by use of %b, %h or %d.

It can print to the uart in Programmed IO or interrupt mode. Or it can just dump an ascii string in memory at the TX buffer location( has a size of 2 x 128 bytes.

The linker works for the LPC as well. And upcoming template files i have almost finished but i cannot test them on hardware.

I have now the functions :

UsedTimers.

RequestTimer.

ReleaseTimer.

Timer.

Strlen.

PrintString.

I am building a little OS for learning purposes. I have not yet figured out if it will be preemptive or cooperative or a mix of both.

I am busy experimenting with SAR based servo control functions.

Instead of doing heavy PID calculations i want to use the successive approximation technique to modify the PWM signal to the motor. The error input will be the input to the SAR algorithm and the output will be a pwm value controlling the motor. I will not use the electronics of the servo, instead i will drive the motor directly by use of an TLE5205-2 and read the the position directly with the ADC.

EDIT:

Forgot to mention that with exception of the os and the pwm function i will add the timer and string functions as well to the upcoming iteration of W-ARM.

Hi Steve,

At the moment i am working on template files for the LPC. It is my wish to make the LPC code as readable as is the SAM7S code i have written. I wish to use an LPC development board from for example olimex as example hardware to create pin defninitions. I prefer to use an LPC2106. Because when i have finished my basic OS i can port it easy to this controller since the memory is very similar to the SAM7S256.

I have finished the startup.s and the low_level_init.c . I added comments and i added some flags to the LPC210x.h file.

I am now looking at how to port my code for the SAM7S to make it run on the LPC as well. This means that i have to set up the VIC as well in order to use uart interrupts and timers. I have some examples i am studying. It is my desire to create a functional template / example for when any starter to the arm wishes to use an LPC and W-ARM. I am sure that when it works, it will be enjoyed by starters new to ARM. :smiley:

Do you have any preference about which olimex board to use ? Another board is ok as well. But i prefer a board where i can have an pdf with schematics. Because then i can make a basic headerfile with pin definitions.

The vastly larger number of users of NXP ARM7 and ARM/Cortex, versus Atmel ARM, will benefit.

I did my ARM7 work with IAR, and a generic c startup. My app does all the PLL and VIC initialization. I prefer to control all that so I know what I have as I add my own I/O things.

I see.

I have decided to compromise. Since my time is limited, i will make a basic generic led blink template with a basic stringprint function but without interrupts and timer functions because it might be that i create a bug and i cannot test it since i do not have the hardware. If any person would desire the code i have written for the SAM7S to be ported to NXP ARM7TDMI models, that they can use it themselves, that person and i can enter an collaboration to do this as a solution. This way i can have more time to create what i have on my wishlist. If people are interested, they can always post a reply here with an request. That way i do not have to design for controllers i do not have in my possession and which i very likely will not use myself. I mean the chance of a bug increases when i cannot test it myself or with the help of others testing it on their hardware.

I will use the LPC2106 developmentboard : LPC-P2106 as the hardware platform example. This is a common board and the schematic is i assume a common basis to start from. Schematics can be found on the olimex website or right here on the sparkfun webshop.

I noticed it is on sale at sparkfun as well.

When looking through the datasheets, i do find it disappointing that the LPC2106 does not seem to feature an internal ADC. The SAM7S has an internal ADC.

If there are enough requests, i will add support for the LPC2136 and LPC2138 as well because both have an internal ADC but only 32kB ram.

Nevermind, i decided to add the LPC2129, LPC2134, LPC2136, LPC1238 as well for the upcoming release V0.93 (V0.92 is superseded ).

As a datasheetmuncher, i noticed that there are LPC2134, LPC2136, LPC2138 and the better and improved version : LPC2134/01, 2136/01 and the LPC2138/01. The latter version have better and faster hardware.

The LPC2103 has an ADC. You might be better off with one of the newer Cortex M-0 or M-3 chips.

Indeed the LPC2103 does. It is a bit small in memory i think.

I will be playing with cortex M3 soon. I am planning support for the LPC1768, SAM3S4B, lm3s1968 and some chip from ST i have not decided yet.

But remember, W-ARM is just a simple IDE for the enthusiast. It is not a fully featured professional IDE. However, for us datasheetmunchers it works great. :smiley:

I added the LPC 2129, 2134, 2136, 2138. It was easy done since the memory specifications are similar to the LPC 2104 and LPC 2105.

Now i only have to finish the basic example template for the LPC and i can put the new verison of W-ARM on sourceforge.

I am also busy improving the manual.

Hi steve and others who would like to test it.

Well, i posted everything on sourceforge :

You have to test the LPC source code yourself. i wrote it from scratch, but i do not have the hardware to test it.

If you start a new project and select an LPC MCU, select copy template files in the project menu of the W-ARM program manager. It will then copy the template files to your current project src and inc directories.

I added a new version of the manual on sourceforge : V1.2

It explains a lot more now.

I added a rarfile with only the program manager, template files and the PN2 editor : W_ARM_NOGCC_07112010.rar .

This way if you have already the complete W-ARM package, you do not have to download the entire GCC again since that is not changed.

Afcourse i have added the complete W-ARM package as well : W-ARM07112010.

But i hope it will appear because i have the feeling something went wrong while uploading to the sourceforge site.

Sourceforge behaved a bit strange. If it does not appear i will upload it again over a few hours.

If you want to try it anyway, this is the directory structure :

It needs yagarto GCC 23122009 distribution and GCC 23122009 tools.

W-ARM->

…->W-ARM_PM

…->PN2

…->GCC 23122009 distribution ( all directories such as bin/, arm-elf/ ,etcetera…)

…->GCC 23122009 tools. ( all directories such as utils/bin)

This is the changelog for W-ARM V0.93:

Change log :

version 0.93

  • Added more assembler instructions and directives to assembler scheme of PN2.

  • Added basic support for the LPC2104, LPC2105, LPC2106, LPC2129, LPC134, LPC2136, LPC2138.

  • Added basic template files for LPC210x. These are comprised of header files and basic startup C code.

  • Added multi interrupt support for the SAM7S. All interrupt handlers can be written in C.

The assembler part is taken care of by the Advanced interrupt controller of the SAM7S and by a little assembler

code i have written from studying the examples in ARM cook books and the Atmel datasheet.

All interrupt handlers written in C are stored in RAM to speed up execution and reduce interrupt latency.

I have provided some examples.

I am busy standardizing the semi_stdio.c file with usefull functions. All these functions depend heavily

on the hardware if needed. But most only use generic ARM7TDMI core C code. When in case the onboard hardware gives a

speed advantage i will take advantage of this hardware. All code has comments and is very clear to understand.

  • Printstring supports now %b,%h and %d for unsigned conversion of 1 32bit value.

The routines are optimized to run as much from registers as possible. I estimate no stack is used.

All output is directly written into a memory buffer which serves for the UART TX interrupt.

Printstring can be configured to run in PIO mode or INT mode. The first is programmed IO in a software loop.

The second is interrupt based and free’s up the CPU for other calculations if OS_MEM_PRTSTR_NO_WAIT is set to 1.

if OS_MEM_PRTSTR_NO_WAIT is set, then the user code must check for OS_MEM_UART_TXNRDY to be cleared before

using printstring again.

  • There are 9 timers out of 11 timers available through use of functions and can be written to and read from similar as

hardware pheriperals.

Timer 10 is for now used by printstring but will be free to use when the multitask os i am working on is finished.

Timer 11 is used for the TWI hardware as timeout timer but will be free to use when the multitaks os i am working on is finished.

When the TWI interface or printstring are not used, Timers (11) and (10) can be used at any time.

  • Removed a bug in the LPC linker generator.

  • Removed a bug in the SAM7S linker generator where a possible alignment error could occur.

  • Removed a visual bug at the project tab that popped up when the projectname is too short.

  • A strlen function is added.

I hope it works, if there are any errors or bugs please let me know, i will solve them as fast as i can.

Here is the link :

http://sourceforge.net/projects/warmdevkit/files/

I have uploaded the complete package again. W-ARM v0.93 is now available on the sourceforge site.

The package is 88.4MB on my ntfs disk. It is 92,762,417 bytes in size.

I checked everything with my up to date virus scanner. There are no viruses.

I can continue working on my os.

When there is an issue or a bug, i always would like to be informed. Then i can as soon as possible solve the issue.

:smiley: