[amnb] build error with code from g071 example #1215
-
Hi all, i'm quite new to modm an trying to evaluate if the amnb protocol is something for my application. With the great docs i started a project on the F4-disco board and used the nucleo-g071 amnb example as a base. But when compiling i get this error:
The code is a direct copy of the example: class Thread : public modm::pt::Protothread
{
modm::ShortPeriodicTimer tmr{1s};
uint32_t counter{0};
Result<uint8_t> res1;
Result<uint8_t, uint8_t> res2;
public:
bool inline
update()
{
PT_BEGIN();
while(true)
{
PT_WAIT_UNTIL(tmr.execute());
LedGreen::toggle();
node1.broadcast(1, counter++);
node3.broadcast(2);
res1 = PT_CALL(node2.request<uint8_t>(1, 1));
MODM_LOG_INFO << "Node1 responded with: " << res1.error();
if (res1) { MODM_LOG_INFO << " " << *res1 << modm::endl; }
res2 = PT_CALL(node1.request<uint8_t, uint8_t>(3, 2, counter));
MODM_LOG_INFO << "Node3 responded with: " << res2.error();
if (res2.hasUserError()) {
MODM_LOG_INFO << " " << *res2.userError() << modm::endl;
}
}
PT_END();
}
}
thread; I cant see the error here. PT_BEGIN is where it should be, i see no declaration of a local variable which could be uninitialized in a next case, in short i dot get what gcc is saying to me. Is this a potential bug or is it me doing something wrong with protothreads? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Are you using GCC13 by any chance? Our protothreads macros only work with ≤GCC12 sadly. Try to either use GCC12 or enable the |
Beta Was this translation helpful? Give feedback.
-
I read from that, that fiber is the way to go for my application? |
Beta Was this translation helpful? Give feedback.
I fixed it in the PR, turns out I implemented AMNB with two threads one for transmission and one for reception.