Search found 98 matches

by king2
Sun Jan 14, 2018 11:13 am
Forum: Development and Feedback
Topic: Serial Driver Event Handling Example
Replies: 13
Views: 516

Re: Serial Driver Event Handling Example

I got where mistake is: sdWrite() followed by chEvtWaitAny() and possibility for thread to be woken up not by my event only (and pass chEvtWaitAny for no good reason, i.e. with CHN_TRANSMISSION_END not set). Sometimes it wakes up by unknown reason with flags = 0. It passes chEvtWaitAny(), and can st...
by king2
Fri Jan 12, 2018 6:13 am
Forum: Development and Feedback
Topic: Serial Driver Event Handling Example
Replies: 13
Views: 516

Re: Serial Driver Event Handling Example

OK, I have a code in a function that sends a packet: chEvtWaitAny(EVENT_MASK(0)); eventflags_t pending = chEvtGetAndClearFlags(&cmdListener); if (pending & CHN_TRANSMISSION_END) palClearPort(GPIOF, CONSOLE_DE); In fact, after a time of working correctly (wakeup on CHN_TRANSMISSION_END only),...
by king2
Thu Jan 11, 2018 5:45 pm
Forum: Development and Feedback
Topic: Serial Driver Event Handling Example
Replies: 13
Views: 516

Re: Serial Driver Event Handling Example

Sorry, but I still cannot understand.

We have a line at start of the thread:

Code: Select all

chEvtRegisterMaskWithFlags(&SD4.event, &cmdListener, EVENT_MASK(0), CHN_TRANSMISSION_END);

Will it raise event on CHN_TRANSMISSION_END only, or it will raise events on all flags except CHN_TRANSMISSION_END?
by king2
Thu Jan 11, 2018 4:21 pm
Forum: Development and Feedback
Topic: Serial Driver Event Handling Example
Replies: 13
Views: 516

Re: Serial Driver Event Handling Example

Giovanni wrote:After writing, you get first CHN_OUTPUT_EMPTY when the software queue is empty then CHN_TRANSMISSION_END when the UART is done sending the last frame.

Wow, I will get CHN_OUTPUT_EMPTY even if I using CHN_TRANSMISSION_END as 4th argument of chEvtRegisterMaskWithFlags()?
by king2
Thu Jan 11, 2018 12:28 pm
Forum: Development and Feedback
Topic: Serial Driver Event Handling Example
Replies: 13
Views: 516

Re: Serial Driver Event Handling Example

Only one point of write to SD4 exists, and it is shown in my sources. As I understand, it should pass chEvtWaitAny() line ONLY if CHN_TRANSMISSION_END was raised, so, next write can be done only after previous was already fully completed. If I do chEvtRegisterMaskWithFlags(&SD4.event, &cmdLi...
by king2
Thu Jan 11, 2018 11:28 am
Forum: Development and Feedback
Topic: Serial Driver Event Handling Example
Replies: 13
Views: 516

Re: Serial Driver Event Handling Example

I have tried simplified version of this, I need just to turn off DE line after sending was finished. I do at start of thread: chEvtRegisterMaskWithFlags(&SD4.event, &cmdListener, EVENT_MASK(0), CHN_TRANSMISSION_END); then sending: // set DE and send packet palSetPort(GPIOF, CONSOLE_DE); sdWr...
by king2
Sun Jun 11, 2017 1:56 am
Forum: Bug Reports
Topic: STM32 RTCv2 daylight flag Topic is solved
Replies: 1
Views: 232

STM32 RTCv2 daylight flag Topic is solved

Just found: STM32 RTC module can set daylight saving time in rtc_lld_set_time (RTCv2/hal_rtc_lld.c), but not resetting this flag if it was set before.
by king2
Sun Jun 11, 2017 1:52 am
Forum: ChibiOS/HAL
Topic: EXT initiated SPI
Replies: 2
Views: 280

Re: EXT initiated SPI

I have tried this with no luck.
Everything started to work after moving sensor initialization to thread instead of 'before main loop' section.
by king2
Fri Jun 09, 2017 11:19 pm
Forum: ChibiOS/HAL
Topic: EXT initiated SPI
Replies: 2
Views: 280

EXT initiated SPI

Hi! I working with device that makes interrupt when measurement is ready by rising its INT pin (connected to stm32f411's EXTI pin). When device has finished measurement and set its INT pin, I need to get new data via SPI in ~300us, accurately, ~2000 times per second, without missing any data. I set ...
by king2
Mon Apr 17, 2017 8:08 am
Forum: STM32 Support
Topic: Stacks and heap, and other memory areas
Replies: 4
Views: 424

Re: Stacks and heap, and other memory areas

Thanks you for answer!

So, main stack is a CSTACK, as I understand, process stack is a CSTACK too in this case, and thread stack is a stack located in thread variable, right?
What is HEAP and who uses it?

Go to advanced search