AdaCore / embedded-runtimes

runtimes that add support for various boards to the GNAT GPL compiler for ARM
Other
14 stars 16 forks source link

Example to test out port to new platform #16

Closed martinmarcos closed 7 years ago

martinmarcos commented 7 years ago

Some colleagues and I are in the process of porting the embedded-runtimes to the EDU-CIAA-NXP board.

The EDU-CIAA-NXP is one of the development boards that integrates CIAA Project framework. It was designed to be used for educational purposes involving embedded systems. I don't have the precise number but there is around 1500 of these boards distributed across Argentina mostly in educational institutions such as universities and technical schools. We are planning to register a project to be developed with this board in the Make with Ada competition.

The board has a NXP LPC4337 microcontroller which houses a Cortex-M4F and a Cortex-M0 , an FTDI JTAG/UART USB adapter that can be used with OpenOCD, an USB OTG connector, a voltage regulator that can power the board from the USBs or a header, an RS485 transceiver, an RGB LED, 3 conventional LEDs, 4 pushbuttons and 2 expansion headers that can be used to connect daughter cards called "ponchos". More information on the EDU-CIAA-NXP board can be found (unfortunately in spanish only) here.

We generated the Ada bindings with svd2ada and started out by taking at look at the port @euripedesrocha was working on for a similar board. The port we are doing though is based on a stm32f4 bsp and following the instructions from @lambourg's post. Right now we are working on the UART configuration for the s-textio.adb and we think we are almost done with the porting. We are starting to worry on how to test it out on the actual board. We need an example. We know of the existence of the Ada_Drivers_Library and we are thinking of porting the _hello_worldblinky and _hello_worldtasking examples. We were planning to continue porting that library afterwards anyway. What do you guys suggest? We've been looking but we haven't found some kind of porting guide for the Ada_Drivers_Library, if we missed it please send us the link, if there isn't one then be sure we'll be submitting our doubts.

We are anxious to upload our code to GitHub so others can start reviewing it or using it. We'll let you know.

Fabien-Chouteau commented 7 years ago

Hi Martin,

All this sounds very exciting!

We are starting to worry on how to test it out on the actual board. We need an example. We know of the existence of the Ada_Drivers_Library and we are thinking of porting the hello_world_blinky and hello_world_tasking examples. We were planning to continue porting that library afterwards anyway. What do you guys suggest?

A proper testing of the run-time would require a lot of tests of course, but checking only a few features would be enough for you I think. Here's what I would recommend:

We've been looking but we haven't found some kind of porting guide for the Ada_Drivers_Library, if we missed it please send us the link, if there isn't one then be sure we'll be submitting our doubts.

You're right, we're missing a porting guide for the Ada_Drivers_Library. It's on the TODO list but I don't have a deadline to give you. The best I can say is to mimic what is already done and open issues on the GitHub repo if you have questions.

Regards,

martinmarcos commented 7 years ago

@Fabien-Chouteau, we've just uploaded the runtime for the EDU-CIAA-NXP board here. It needs improvement obviously, but it builds. It would be awesome if you guys could take a look at it and review it.

As far as the test example goes, we haven't even been able to run a simple blinky. We've been able to flash the board and debug it. Debugging we've observed the runtime seems initialize correctly but as soon as the example code gets executed the board crashes. We'll be uploading our test example to GitHub soon so it gets reviewed also.

Thanks.