Found this old post while searching for support for Bit Banding in ChibiOS.
This is a generic macro that seems to do the job:
#define BB_(periph) (&(periph) + (PERIPH_BB_BASE - PERIPH_BASE)/sizeof(uint32_t))
Here's an example of its usage:
void stepperReadyCB(EXTDriver *extp, expchannel_t pad ...
Search found 65 matches
- Mon Nov 05, 2018 8:24 am
- Forum: Development and Feedback
- Topic: Bit-banding, a fast and legible GPIOx output
- Replies: 1
- Views: 9408
- Thu Jul 19, 2018 7:34 am
- Forum: Small Change Requests
- Topic: The __earlyInit() hook was not early enough
- Replies: 2
- Views: 5945
The __earlyInit() hook was not early enough
Hi,
I just spent a few days fighting to get a new board to reset reliably.
One of the problems encountered was due to the board's having a 1kOhm resistor in series with its 3.3V power input until bypassed by a FET under software control. This was done to limit inrush, as up to sixty of these boards ...
I just spent a few days fighting to get a new board to reset reliably.
One of the problems encountered was due to the board's having a 1kOhm resistor in series with its 3.3V power input until bypassed by a FET under software control. This was done to limit inrush, as up to sixty of these boards ...
- Wed Nov 29, 2017 9:20 am
- Forum: Development and Feedback
- Topic: GenericQueue with counter?
- Replies: 8
- Views: 8068
Re: GenericQueue with counter?
I've been running Chibios 2.6.10 with lockless queues from some months now.
There was a race in the examples I posted earlier.
Here's the current working code for fast queue reading:
/**
* @brief Input queue read with timeout when no other reader thread exists
* @details The function reads data ...
There was a race in the examples I posted earlier.
Here's the current working code for fast queue reading:
/**
* @brief Input queue read with timeout when no other reader thread exists
* @details The function reads data ...
- Fri Sep 08, 2017 7:53 am
- Forum: STM32 Support
- Topic: ICU driver's "overflow" handler seems poorly defined
- Replies: 1
- Views: 2504
Re: ICU driver's "overflow" handler seems poorly defined
In my previous post, I forgot to include the definition of overcap referenced in the revised interrupt service routine:
Code: Select all
#define overcap (STM32_TIM_SR_CC2OF | STM32_TIM_SR_CC1OF)
- Fri Sep 08, 2017 5:19 am
- Forum: STM32 Support
- Topic: Adding ICU support for TIM10 and TIM11
- Replies: 1
- Views: 2755
Adding ICU support for TIM10 and TIM11
I've added support for TIM10 and TIM11 to the ICU driver.
Because TIM10 and TIM11 lack the 2nd compare register the ICU driver normally uses,
I've also had to add support for an additional input mode:
/**
* @brief ICU driver mode.
*/
typedef enum {
ICU_INPUT_ACTIVE_HIGH, /**< Trigger on ...
Because TIM10 and TIM11 lack the 2nd compare register the ICU driver normally uses,
I've also had to add support for an additional input mode:
/**
* @brief ICU driver mode.
*/
typedef enum {
ICU_INPUT_ACTIVE_HIGH, /**< Trigger on ...
- Fri Sep 08, 2017 4:48 am
- Forum: STM32 Support
- Topic: ICU driver's "overflow" handler seems poorly defined
- Replies: 1
- Views: 2504
ICU driver's "overflow" handler seems poorly defined
Hi,
[Note that I'm working with 2.6.10, but I have verified that all this valid for 17.x as well]
The ICU driver's interrupt handler ends with the following statement:
if ((sr & STM32_TIM_SR_UIF) != 0)
_icu_isr_invoke_overflow_cb(icup);
This causes the overflow handler, if registered, to be ...
[Note that I'm working with 2.6.10, but I have verified that all this valid for 17.x as well]
The ICU driver's interrupt handler ends with the following statement:
if ((sr & STM32_TIM_SR_UIF) != 0)
_icu_isr_invoke_overflow_cb(icup);
This causes the overflow handler, if registered, to be ...
- Sun Mar 26, 2017 7:28 pm
- Forum: Small Change Requests
- Topic: Add Polled Mode Serial Output for Panic Messages
- Replies: 0
- Views: 3662
Add Polled Mode Serial Output for Panic Messages
I propose adding a polled output mode so panic messages can be output on a serial port with interrupts disabled.
This gives some feedback as to the cause of a crash in situations where no debugging probe is installed.
Here's a hacked up example for the STM32v1 serial drivers:
/**
* @brief Switch ...
This gives some feedback as to the cause of a crash in situations where no debugging probe is installed.
Here's a hacked up example for the STM32v1 serial drivers:
/**
* @brief Switch ...
- Thu Mar 23, 2017 3:48 am
- Forum: Development and Feedback
- Topic: Allowing thread local storage for mainthread
- Replies: 1
- Views: 2946
Allowing thread local storage for mainthread
ChiBiOS threads support thread local storage between the Thread struct and the thread's stack (which typically grows down toward the Thread struct). These thread local variables are handy and worked great until I tried using it on mainthread.
Then, instant segfault panic, because the mainthread's ...
Then, instant segfault panic, because the mainthread's ...
- Thu Mar 23, 2017 3:29 am
- Forum: Development and Feedback
- Topic: Debugging improvements.
- Replies: 26
- Views: 25476
Re: Debugging improvements.
Just adding another vote for a polled output mode in serial drivers so that panic messages can be output when no debugger is attached. I hacked this into the STM32L serial drivers, but there's no reason it couldn't be done more generically:
/**
* @brief Switch to polling mode (disable interrupts ...
/**
* @brief Switch to polling mode (disable interrupts ...
- Wed Mar 01, 2017 11:34 am
- Forum: Development and Feedback
- Topic: GenericQueue with counter?
- Replies: 8
- Views: 8068
Re: GenericQueue with counter?
How can the existing counter be made a single byte if the queue size > 255 bytes?
I suppose the "counter" could be reduced to simple flag that gets set when the fifo becomes full and cleared when it becomes empty.
Is this what you have in mind?
As far as FIFO full/empty tests, I don't see much ...
I suppose the "counter" could be reduced to simple flag that gets set when the fifo becomes full and cleared when it becomes empty.
Is this what you have in mind?
As far as FIFO full/empty tests, I don't see much ...