Novice questions

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

king2
Posts: 98
Joined: Mon May 28, 2012 1:57 pm
Been thanked: 2 times

Novice questions

Postby king2 » Mon May 28, 2012 2:23 pm

I just selecting RTOS suitable for me, so I have some questions (search doesnt work for me :( ) I using STM8 for my projects for now.

1. STM8 does not have much HAL drivers, such as CAN, I2C, ADC and so on. Do you plan to implement it? If yes, when? :)
2. STM8 does not have support for IAR, which I'm using now. Is it simple to use ChibiOS/RT in IAR for STM8? How to do this?
3. If I have some threads that is blocking (one does I2C exchange with polling, waiting and while{} loops, another one exchanges with another module via UART, another one do endless reporting to another UART and so on) - will it work together in ChibiOS without any additional modifications to code of this tasks? Or I should add some code to let OS chance to decide when it should save registers, when it should not to switch task and so on? Or all this will be done automatically?
4. When I can find step to step instructions how to make new project? Which files are needed, how to make ChibiOS folder intact and project independent? Or I should copy "os" folder into project each time I start new project?
5. I have seen into the HAL part of ChibiOS and found no rocket sience inside. Why it was not implemented for STM8, for example? May be, you have some reasons for it? Can I do it by myself (for example, if you just have no time for such little and cheap MCU :) ) or reasons more complicated?

Thanks in advance and please excuse me for such lamer's questions :)

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

Re: Novice questions

Postby Giovanni » Mon May 28, 2012 6:11 pm

Hi,

1) A extension of the STM8 HAL is planned but it is behind several more urgent tasks so I cannot answer to "when". The STM8 port has not received much interest so far (zero feedback) so it is not a huge priority. Probably this is caused by lack of a good free compiler unlike most other micros. The three commercial compilers available all have their limits: The first is super expensive, the second generates inefficient code and the third is too buggy, guess who is who :-)

2) Porting to the IAR would be easy there are very few changes to do starting from the code for other compilers. It is not yet included because the IAR free version is limited to 8K which is not sufficient to run the test suite. Unless there is a paying customer requesting it the IAR will not be supported.

3) Inside a task you can use any code, it may be inefficient because polling but it would work.

4) Look at the various STM8 demos, the OS directory is external to the projects. You just have to include the right files in your IAR project.

5) Just I have other priorities, creating drivers for the STM8 is very simple, its peripherals are often similar to peripherals found on the STM32 so STM32 drivers can be used as starting point. Sadly there are many differences between STM8L and STM8S, which one are you planning to use? An experienced embedded programmer could definitely create more drivers.

Giovanni

king2
Posts: 98
Joined: Mon May 28, 2012 1:57 pm
Been thanked: 2 times

Re: Novice questions

Postby king2 » Mon May 28, 2012 7:27 pm

Ok, thank you for answers.
I tried to compile ChibiOS in IAR, and now I have two threads running together on STM8S-DISCOVERY board.

I will try to make HAL drivers for it later (what means or as I will need some driver, or never, if I will not start ChibiOS with my project :) )
If you interested, I can send added/modified files (for IAR), may be somebody else will need this?

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

Re: Novice questions

Postby Giovanni » Mon May 28, 2012 8:37 pm

Sure, thank you, post them on the forum.

Giovanni

king2
Posts: 98
Joined: Mon May 28, 2012 1:57 pm
Been thanked: 2 times

Another question

Postby king2 » Mon May 28, 2012 9:57 pm

So, now I have two threads - one for UART communications, and another one - for 1wire.

When 1wire transfers started - I have UART thread pseudo-suspended, as you can see on picture (red - 1wire, yellow - UART).

When I changed prescaler of system timer to lower value (from 16 to 4) - this effect was not so clear, but there is definitely a delay between yellow pulses.
What should I do to get do not allow threads to interfere between each other?

Thanks!

update: sorry for disturbing you, I have changed CH_FREQUENCY to 200 and CH_TIME_QUANTUM to 3 and now all is fine.
Attachments
20120529_105156.png
20120529_105156.png (41.92 KiB) Viewed 2773 times


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 14 guests