Trouble with IfxCpu_waitEvent causing code to not run

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19424
Level 3
Level 3
First solution authored First like received
Hello,
I implemented a serial functionality that sends (only sends) data via asclin/uart. (Code is based on UART_VCOM for TC297)

It works fine for a bit and sends what I want, but then suddenly IfxCpu_waitEvent simply stops the functionality. Nothing Crashes, when I continue running my program the rest of the data needed to be sent, simply isn't sent.
The code that is supposed to run it also doesn't run.

Now, the millisecond argument it receives was set at 1 millisecond. I changed it to 2 and that just made my code send even less data before it stops.
I then tried setting it to 0, but that caused my code to send pure gibberish (this: ?▒▒▒▒▒▒▒▒▒▒▒▒▒?▒▒▒▒▒ ▒ ▒?▒▒▒▒?▒▒▒▒ ▒▒▒?)

and Even Weirder is that when debugging and manually stepping for every assembly line, it seems to work and print the correct data.

Can someone explain to me how does IfxCpu_waitEvent/IfxCpu_emitEvent work? what does the millisecond thing mean? and why does debugging generate different results than running normally?
And how to I just cause my code to run normally without these functions interfering? I tried removing them but that also caused my code to send gibberish.

Thank you!
0 Likes
1 Reply
User19424
Level 3
Level 3
First solution authored First like received
Anyone know?

I guess another solution that would help me is just how to cancel the use of these functions. just make the code run as a single "thread" with no events synchronization and such (Temporarily, and after my functionality ends return everything to normal)
0 Likes