Platform support

ChibiOS public support forum for topics related to the NXP LPC family of Cortex-M micro-controllers.
User avatar
jcw
Posts: 55
Joined: Thu May 23, 2013 12:59 am
Location: Houten, NL

Platform support

Postby jcw » Sun Nov 02, 2014 9:16 am

I've been using ChibiOS for a number of projetcs, using various chips and boards from STM and LPC, mostly. So far, getting thigs going for STM has been very easy, and for LPC it was fairly easy as well to adapt existing demos and makefiles. For as-yet unsupported LPC chips, I managed to make it work by hooking stuff into the ChibiOS makefile setup, but mostly that has led to a non-standard setup, i.e. not adding stuff into the ChibiOS tree, but hacking together my own headers, makefiles-which-then-include-the-chibios-makefile, and some ld files thrown together as needed.

Most of this was for 2.6, but for new projects I've started using 3.0, and really like the option of trying out Nil for low-end builds at some point.

For LPC, the 3.0 branch has not yet received much public attention, as far as I can tell. The CMSIS files are not in there, nor any demos for the ARMCMx series. Also, CMSIS 4 is out now, but ChibiOS still uses 3.2 (I don't know if there are important changes).

- is ChibiOS becoming an STM-mostly os? is it due to the lack of interest and access to all those other boards?
- are LPC contributions welcome, even if I don't necessarily volunteer as long-term maintainer for them?
- are there code bases for LPC that people are working on, which I could look at for guidance and as starting point?

In short: I very much like the essence of ChibiOS, in particular 3.0, and would like to spend more time extending and contributing to it in the ways it has evolved in 3.0, but it's a fairly big job, and I'm a little concerned by the current rate of change on the non-STM side of things, in particular the LPC8xx and LPC11xx variants.

-jcw

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Platform support

Postby Giovanni » Sun Nov 02, 2014 10:10 am

Hi,

ChibiOS is not meant to be STM-only, I am personally committed in keeping it as platform-neutral as possible.

Said that, the problem is bandwidth, the only platforms ported to 3.0 are those with an active maintainer, I cannot realistically handle more than one family in addition to the two kernels.

Giovanni

User avatar
jcw
Posts: 55
Joined: Thu May 23, 2013 12:59 am
Location: Houten, NL

Re: Platform support

Postby jcw » Mon Nov 03, 2014 7:18 pm

Hello Giovanni,

While I understand and respect your position, it would actually be a lot easier to handle different platforms if you were to support at least one of each type. The ST32F µC's are probably a lot easier to port across different variations, than starting on a new one.

Having said that, I did start out on the LPC812, just to see what it takes. I'm taking hints from the LPC214x and the KL2x already in there, but I'm hitting a wall:

Code: Select all

$ make
Compiler Options
arm-none-eabi-gcc -c -mcpu=cortex-m0 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/ -DCORTEX_USE_FPU=FALSE -mno-thumb-interwork -MD -MP -MF .dep/build.d -I. -I../../../os/ext/CMSIS/include -I../../../os/ext/CMSIS/NXP -I../../../os/common/ports/ARMCMx/devices/LPC8xx -I../../../os/rt/ports/ARMCMx -I../../../os/rt/ports/ARMCMx/compilers/GCC -I../../../os/rt/include -I../../../test/rt -I../../../os/hal/include -I../../../os/hal/osal/rt -I../../../os/hal/ports/LPC/LPC8xx -I../../../os/hal/boards/EA_LPCXPRESSO_LPC812 -I../../../os/various main.c -o main.o

mkdir -p build/obj
mkdir -p build/lst
Compiling chcoreasm_v6m.s
../../../os/rt/ports/ARMCMx/compilers/GCC/chcoreasm_v6m.s:1:0: error: target CPU does not support ARM mode
 /*
 ^
make: *** [build/obj/chcoreasm_v6m.o] Error 1
$


Could you or anyone working on LPC's give me a hint on how to chase down the cause of this error message?

-jcw

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Platform support

Postby Giovanni » Mon Nov 03, 2014 8:23 pm

Porting drivers is easy. It is important that you use makefiles and configuration files from 3.0 (from a demo targeting the SAME core), probably your problem is there, also look for the 3.0 port guide in the documentation section.

http://www.chibios.org/dokuwiki/doku.ph ... rom_2_to_3

Porting a driver means mainly removing any reference to "ch" functions and replace them with the equivalent function in OSAL.

Giovanni

User avatar
jcw
Posts: 55
Joined: Thu May 23, 2013 12:59 am
Location: Houten, NL

Re: Platform support

Postby jcw » Mon Nov 03, 2014 11:12 pm

Ok, thanks for that reference - hadn't seen it. Making good progress now.

Another Q: what is the new name for IOREG32?

-jcw

User avatar
jcw
Posts: 55
Joined: Thu May 23, 2013 12:59 am
Location: Houten, NL

Re: Platform support

Postby jcw » Mon Nov 03, 2014 11:40 pm

Never mind. Inserted volatile uint32_t for now.

-jcw

User avatar
jcw
Posts: 55
Joined: Thu May 23, 2013 12:59 am
Location: Houten, NL

Re: Platform support

Postby jcw » Tue Nov 04, 2014 12:13 am

Ok, it compiles. The added files/dirs so far are:

Code: Select all

demos/LPC8xx/
os/common/ports/ARMCMx/compilers/GCC/ld/LPC812.ld
os/common/ports/ARMCMx/devices/LPC8xx/
os/ext/CMSIS/NXP/
os/hal/ports/LPC/LPC8xx/
os/rt/ports/ARMCMx/compilers/GCC/mk/port_lpc8xx.mk

Next step will be to debug this stuff. Some clock or nvic issue, I believe. Getting there!

-jcw

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Platform support

Postby Giovanni » Tue Nov 04, 2014 8:56 am

Ah right, now the function that enables an interrupt vector takes the priority level as parameter not the priority mask. See any STM32 driver for example. You have to remove the macro that converts from mask to priority from the call.

Giovanni


Return to “LPC Support”

Who is online

Users browsing this forum: No registered users and 2 guests