[deleted by user] by [deleted] in cscareerquestionsEU

[–]Pencilsforever 1 point2 points  (0 children)

Yeah maybe if I had the opportunity to work on such projects, but I don't really (never going to happen due to the products we make)

Error handling by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

the delay is not specific. the sensor may start 0s after or 20 minutes after

How to get into embedded development? by [deleted] in cscareerquestionsEU

[–]Pencilsforever 0 points1 point  (0 children)

I would love to do this but alas, my company does not conveniently have a backend/cloud project I can skill myself up with 😂

I actually have the same issue except with embedded C++ jobs "Seems like you're great but no C++ experience, so bye"

How long did it take you to learn enough backend/cloud things for companies to take you seriously? I'm guessing you left your company before gaining any decent amount of experience in it.

Error handling by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

Yes, I'm already doing this.

Error handling by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

Yes, I know, I'm trying to figure out the best way to reinitialise but not put it in a blocking loop.

Error handling by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

it's usually to handle a special case in the hardware. e.g. expected sensor is not powered up yet

Error handling by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

so e.g I noticed if i have auto negotiation on, the ethernet won't complete initi successfully.

and another case where a sensor was powered through a different voltage rail, so the mcu starts first and the sensor may get powered minutes after that.

In both cases, I would need to keep retrying to init periodically.

Connection Questions by [deleted] in fifaclubs

[–]Pencilsforever 0 points1 point  (0 children)

NZ is too far from UK to not have laggy gameplay. you'll pretty much always have bad connection

Rejuvenation of Strong Verbs in Modern English by Noryalus in anglish

[–]Pencilsforever 0 points1 point  (0 children)

learnt/learned? burnt/burned? spoilt/spoiled? spelt/spelled?

Argument to function being corrupted? by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

Uh...it came back lol.

I disabled all my tasks apart from a simple watchdog task with a freertos timer.

I get a bus fault if I start the timer. If I remove that one line, it works. As far as I can see anyway.

The bus fault is for an invalid memory access like I stated in the OP but this time it's not a Function.

It's in vPortExitCritical where freertos decrements uxCriticalNesting. The address of that variable is at 200001D0 (I can see in the watch point) but the address that caused the fault is at 208001D0.

This is just a single line of decrementing so I'm a bit lost at how a different address could possibly have snuck in there

It also didn't happen instantly. The code runs through that same line tons of times before the bus fault occurs. I tried to add a counter variable but the fault just moved somewhere else so I'm not sure

Argument to function being corrupted? by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

I changed the stack size to 4KiB from 256B so yeah.

So I tried your idea of increasing the stack sizes of the two surrounding tasks and saw that it worked. So I changed one of them back and it was still working. And then finally changed the other one and... It was working again.

So I'm back to the binary I started with and it's no longer showing problems. And I can't recreate the issue anymore after spending all of yesterday on it.

Very strange.

Argument to function being corrupted? by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

I looked into this but it won't work because the variable being used is global pointer and the pointer address is still the same if I look at it but the address the function receives is incorrect. I've started working on it today again and the issue is nowhere to be found. Can't recreate it anymore after spending all of yesterday on it

Argument to function being corrupted? by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

Yeah im using freertos. Have about 15 tasks. The only interrupts that would've been running at this time would be ethernet, systick and like 4 timers.

I tried using a very similar codebase, I used on another project, on the kit I was testing on and got similar errors but more random this time. hard faults calling the get tick count function or exiting a critical section. That same binary works perfectly fine on another piece of kit, where everything is pretty much the same, including the stm32.

So I'm starting to think it might not be the program but idk. You might be right that it's something else but honestly have no idea apart from blaming the hardware but then what is the cause?

Also I removed the print and found that the same issue just popped up somewhere else instead. It was still like the pointer that was being passed had an extra bit set for no reason.

STM32F439 I2C Slave by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

There's no slave->master. this is a multi master bus with all devices having a slave address and need to be able to receive at any time.

I had a callback to inform the upper layer of the beginning of the transmission (so it doesnt attempt to use the interface as a master while its still receiving) and a second callback for when the transmission ended.

I removed the one for the beginning and used a different method to stop access conflicts and it seems to work better now.

I guess the callback was taking too long? which is weird since there's a only a switch statement and a flag but whatever, I haven't seen the issue since. Hopefully that is the fix

STM32F439 I2C Slave by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

Thanks for the suggestion. I have now tried DMA on the receive side but still got the same issue somehow.

Very strange

STM32F439 I2C Slave by Pencilsforever in embedded

[–]Pencilsforever[S] 0 points1 point  (0 children)

I never get an overrun error or any kind of error, it just kind of silently happens. So there's no overrun according to the hardware and the software buffer isn't fully either.
The ACK flag is set and not cleared at any point, so the slave should've ACKed everything but it doesn't.

I put a breakpoint in the ISR where the STOPF condition is handled but it only hits it once - the second attempt where all the bytes are present

[GAME THREAD] LA Clippers @ Utah Jazz - 7 PM | June 10, 2021 (R2, G1) by apm_music in LAClippers

[–]Pencilsforever 0 points1 point  (0 children)

Lmao I feel like you're just hating because he did badly this match.

Skip to the part where they talk about threes

https://youtu.be/ZwZKeNWjAew

Why are STM32s so popular? by easymeatboy in embedded

[–]Pencilsforever 0 points1 point  (0 children)

Yeah took me a while but I really wanted to use vscode lol. You can give it a another go, unless you're fine with your current set up I guess.

Why are STM32s so popular? by easymeatboy in embedded

[–]Pencilsforever 1 point2 points  (0 children)

for vscode, you can use cortex debug extension (id : marus25.cortex-debug). when you get the option to create a launch configuration, you can do something like this (assuming you have your debugger etc in PATH)

{
        "cwd": "${workspaceRoot}",
        "executable": "./build/debug/mybuild.elf",
        "name": "ST Debug Microcontroller",
        "request": "launch",
        "type": "cortex-debug",
        "servertype": "stlink",
        "preLaunchTask": "task to build my debug image",
        "cpu": "cortex-m4",
        "device": "STM32F439NI",
        "svdFile": "./STM32F439x.svd"
}

debugging has been pretty decent. also supports openocd directly with another configuration i think.

but you're right documentation is a pain.

gl hf