NIL without HAL Topic is solved

Discussions and support about ChibiOS/NIL, the almost nil RTOS.
User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

NIL without HAL  Topic is solved

Postby tfAteba » Thu Dec 01, 2016 2:27 pm

Hi Giovanni,

Is it possible to use NIL without HAL ?
My target is an Arduino uno.

I want to use NIL for the RTOS mechanisms that it offer and want to use my own peripherals implementation.
So here is what I did:
I have bring up all file to have the NIL RTOS in my application. Here is the files:
- nil.c and .h
- nilconf.h
- niicore.c and .h
- niltypes.h

I also have a makefile and a main.c file.

I have include nil in my application and it build successfully.

The main use a thread to blink an LED:

Code: Select all

/*
 * Thread 2.
 */
THD_WORKING_AREA(waThread1, 128);
THD_FUNCTION(Thread1, arg) {

  (void)arg;

  while (true) {
    PORTB &= ~(1 << 5);
    chThdSleepMilliseconds(500);
    PORTB |= (1 << 5);
    chThdSleepMilliseconds(2000);
  }
}


But it don't work.

I think there is a problem of time that must be use to generate the chThdSleepMilliseconds delay but I'm not sure!

- Did I need to use another file for this?
- Is it possible to do that another way?

Thanks!
regards,

Theo.

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: NIL without HAL

Postby Giovanni » Thu Dec 01, 2016 3:05 pm

Hi,

Look at the demos \demos\various\NIL-ARMCM0-GENERIC or \demos\various\NIL-ARMCM4-GENERIC, it is just NIL without HAL.

You need to provide the system tick by yourself because that is usually provided by the HAL ST driver.

Giovanni

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: NIL without HAL

Postby tfAteba » Thu Dec 01, 2016 3:14 pm

Ok, I was thinking about timer, I was not so far but not sure.

So I have to provide the system tick :) to make it work.

I will look at those example to understand what going on.

Thanks.
regards,

Theo.


Return to “ChibiOS/NIL”

Who is online

Users browsing this forum: No registered users and 3 guests