Page 1 of 1

Problems with non makefile setup for a new brand ARM Cortex

Posted: Mon Jun 23, 2014 9:08 pm
by MuratUrsavas
I'm trying t create a project for EFM32's with EmBlocks (which is not a makefile based IDE) using the trunk code (3.0.0). I know it's too much for a newbie but please bear with me :)

Since the family is not officially supported I wanted to use just the kernel and it's port. I've been trough lots of compiler errors but came down to one (I hope). It asks for "st.h" file which asks for "st_lld.h". My very limited ChibiOS knowledge says this should be the base timer which ticks for the core. Since it's not officially given, should I implement the code by myself?

Re: Problems with non makefile setup for a new brand ARM Cor

Posted: Mon Jun 23, 2014 11:05 pm
by Giovanni
Hi,

The ST driver is implemented in the HAL, the EFM32 does not have yet an official HAL so the driver is not found, you can disable the tickless mode in chconf.h, that way the ST driver is no more strictly needed, you just have to initialize the systick timer yourself and do the following:

Code: Select all

OSAL_IRQ_HANDLER(SysTick_Handler) {

  OSAL_IRQ_PROLOGUE();

  osalSysLockFromISR();
  osalOsTimerHandlerI();
  osalSysUnlockFromISR();

  OSAL_IRQ_EPILOGUE();
}


I am assuming you are still using the OSAL, if not:

Code: Select all

CH_IRQ_HANDLER(SysTick_Handler) {

  CH_IRQ_PROLOGUE();

  chSysLockFromISR();
  chVTDoTickI();
  chSysUnlockFromISR();

  CH_IRQ_EPILOGUE();
}


The implementation of a basic HAL and an ST driver would allow for the tickless mode, you need a dedicated timer for that.

Giovanni

Re: Problems with non makefile setup for a new brand ARM Cor

Posted: Tue Jun 24, 2014 8:02 am
by MuratUrsavas
I've found the templates and copied to the project. I'd like to implement it for EFM32's, since tickless mode is the "thing" for them.

For the test I wanted to disable the tickless mode but couldn't find it in the "chconf.h". It was copied from the "templates" folder.

Giovanni, is there a guide for the general structure, what's needed for a basic project (just the kernel and it's port), what should be included (file wise) and what should be defined?

Re: Problems with non makefile setup for a new brand ARM Cor

Posted: Tue Jun 24, 2014 9:22 am
by Giovanni
Version 3.0 is still work in progress and does not have specific documentation yet.

In chconf.h you need to set "time delta" to zero in order to disable the tickless mode, you also need to specify a reasonable tick frequency, 1000Hz for example.

In version 2.6.x there is an example project with kernel only (no HAL), you may use that as example but make sure to use all files from 3.0.

Giovanni