[riot-devel] RIOT vectors for Smartfusion2 port

Hauke Petersen hauke.petersen at fu-berlin.de
Wed May 29 08:47:42 CEST 2019

Hi Ashim,

the LPC2387 is unfortunately a very bad example, as this CPU is not very 
well maintained and does not comply with the best practices of structure 
and style that newer CPUs in RIOT use.

The general approach for porting CPUs in RIOT is to rely as much as 
possible on shared code. Keeping this in mind, all the needed startup 
code, base linker scripts, ... etc, are implemented and provided by the 
shared `cpu/cortexm_common` code path. All the specific CPU 
implementations have to provide, are their interrupt vector structure 
(see e.g. `cpu/samd21/vectors.c` or `cpu/stm32f4/vectors.c`), their 
memory layout (see e.g. `cpu/sam0_common/Makefile.include`), their clock 
initialization code (see e.g. `cpu/samd21/cpu.c`), and of course there 
peripheral driver implementations (typically in a `periph` subdir).

So with this, all you need is to extract that information above from the 
vendor libraries and you should be good to go!


On 5/28/19 5:04 PM, Juan Ignacio Carrano wrote:
> Hi Ashim,
> I assume you are basing your SmartFusion port on some existing CPU. If 
> that's the case, it would be useful to know which one. Even better if 
> you can link us to a publicly accessible repo.
>> I have tried including this file in the new cpu folder I created but 
>> get the following error when trying to make:
>> arm-none-eabi-gcc: error: 
>> /home/user/Desktop/SmartFusion2/testjig/riot/2019.04/examples/hello-world/bin/sf2-starter-kit/cpu/vectors.o: 
>> No such file or directory
> The first question is why the build system is expecting to find 
> vectors.o. Not all CPUs generate that file (in your case you would 
> compile startup_m2sxxx.S into startup_m2sxxx.o) I believe the answer 
> to this question lies in the CPU you started with.
> For example: you mention the LPC2387. If you compile any example with
> BOARD=msba2 (which uses that cpu) and look inside "bin/msba2/cpu" you 
> will not find any vectors.o and that's OK.
>> How do I use the above file correctly in the RIOT port? Is there some 
>> configuration that should be changed to use the file properly or 
>> should I convert it to a vectors.c file? If so, how do I go about 
>> doing so?
> AFAIK you should not need to convert anything, just place the .S file 
> in your CPU directory, but without knowing the full contents of the 
> dir it is hard to tell what is happening.
> Regards,
> Juan.
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel

More information about the devel mailing list