Search found 62 matches

by carldong
Fri Apr 07, 2017 12:16 am
Forum: ChibiOS/RT
Topic: What is the thread working area actually used for?
Replies: 1
Views: 1959

What is the thread working area actually used for?

According to documentations I found, it seems to be used for "context switching". However, I find it hard to estimate how much working space is actually needed. I find it intriguing to dig through the code because I couldn't find a straightforward way to search for relevant code. I boil do...
by carldong
Thu Apr 06, 2017 9:40 pm
Forum: ChibiOS/RT
Topic: Does Mailbox block other threads?
Replies: 2
Views: 2311

Re: Does Mailbox block other threads?

Ah, stupid me... 10 seconds after I posted this, I noticed that I should pass (msg_t *) &p instead of (msg_t *) p . Unfortunately `-Werror=all` didn't capture this one... And indeed this operation yields to other threads. Can I assume anything in ChibiOS that requires waiting will yield to other...
by carldong
Thu Apr 06, 2017 9:36 pm
Forum: ChibiOS/RT
Topic: Does Mailbox block other threads?
Replies: 2
Views: 2311

Does Mailbox block other threads?

I tried to use mailbox + memory pool as a FIFO to communicate between threads. Currently, I tested this configuration on the receiving thread: chMBFetch(&mb, (msg_t *)p, TIME_INFINITE); where `p` is actually a pointer to something in a memory pool. However, as I observed, this line seems to bloc...
by carldong
Fri Mar 31, 2017 6:00 pm
Forum: AVR Support
Topic: Cannot make software serial send more than one character
Replies: 27
Views: 15600

Re: Cannot make software serial send more than one character

Nice work! Maybe this driver can be used to make a hardware independent software serial driver later on? I think it could be a complex driver on top of the EXT, GPT and PAL drivers. I would say, maybe share timer with sysclock. Unless it is doing things like 115k Baud, the overhead should be small ...
by carldong
Fri Mar 31, 2017 3:00 am
Forum: AVR Support
Topic: Cannot make software serial send more than one character
Replies: 27
Views: 15600

Re: Cannot make software serial send more than one character

Oh, right -- It still misses a few characters occasionally. But for my application that is fine. I may put some more time to fix it, though. Just a note: `sdRead()` has inconsistent results. However, `sdGet()` has no problem at all. Since I haven't figured out how to use `sdRead()` yet, I assume tha...
by carldong
Fri Mar 31, 2017 2:52 am
Forum: AVR Support
Topic: Cannot make software serial send more than one character
Replies: 27
Views: 15600

Re: Cannot make software serial send more than one character

AH HAH! I made a mistake in the state transitions, doubling the effective BAUD rate! Now, the full code should be working. I tested single characters and sdRead(). Despite that sometimes it misses characters, probably due to a filled queue buffer, the code should fully work! Not many configurable op...
by carldong
Fri Mar 31, 2017 2:36 am
Forum: AVR Support
Topic: Cannot make software serial send more than one character
Replies: 27
Views: 15600

Re: Cannot make software serial send more than one character

Also, pressing space gives -4, Q_FULL, while anything else gives Q_TIMEOUT, and pressing enter gives nothing... Am I really wrong about how the serial works here?
by carldong
Fri Mar 31, 2017 2:34 am
Forum: AVR Support
Topic: Cannot make software serial send more than one character
Replies: 27
Views: 15600

Re: Cannot make software serial send more than one character

Toggling an LED shows that for some reason the system reads an input around every second, even when I am not typing... Now I am afraid that I also need to debug my USB-TTL cable... Well, I used a 3.3V cable... And switching the board to 3.3V removed this particular issue. However, I still get many s...
by carldong
Fri Mar 31, 2017 1:56 am
Forum: AVR Support
Topic: Cannot make software serial send more than one character
Replies: 27
Views: 15600

Re: Cannot make software serial send more than one character

Ok, got it to work! You won't believe this but the problem is the ISR vector. Your where defining it like this: #define AVR_SDS_RX_VECT PCINT0_vect But it actually is this: #define AVR_SDS_RX_VECT INT0_vect So the MCU was resetting because there was not INT0 handler! Also in the block where you wri...
by carldong
Fri Mar 31, 2017 12:12 am
Forum: AVR Support
Topic: Cannot make software serial send more than one character
Replies: 27
Views: 15600

Re: Cannot make software serial send more than one character

Now I splitted the state machines, and RX and TX no longer conflict! So transmission is working correctly. However, now I cannot receive anything... Not sure whether it is a OS thing or my code. I am way too depleted of glucose to continue today :( https://pastebin.com/jziyaC0r Note that I doubled t...

Go to advanced search