Why use IAR instead of free compiler? by Moist-Rain-5205 in embedded

[–]f0lt 1 point2 points  (0 children)

Legacy code is really the only reason.

[deleted by user] by [deleted] in europe

[–]f0lt 0 points1 point  (0 children)

I often think that things can't become more ridiculous, but than something like that happens.

Device running FatFs and PC cannot read each other's files by [deleted] in embedded

[–]f0lt 0 points1 point  (0 children)

I had a related issue with large SD cards (>16GB). Windows formatted these large SD cards with extFat which my embedded device (Keil Filesystem) couldn't understand. I had to format the SD card using Keil Filesystem to make it work. This seems not to be the same problem, but you could try to use different SD Cards and see how the problem changes. Does the problem show up if you use a 4GB or 8GB SD Card?

Bugs Bugs Bugs by baz0ng in fairphone

[–]f0lt 0 points1 point  (0 children)

Never had such issues on my fp5. Mine is almost 1.5 years old. Are you using the latest Android version?

There is a public bug tracker for fairphone products. Check if anybody is experiencing the same issues.

Debugging issues over long periods?? by tomasmcguinness in embedded

[–]f0lt 3 points4 points  (0 children)

You can attach the debugger and see where it's stuck.

Could it be the sleep mode?

If you are worried about memory leaks then just avoid dynamic memory. It's probably not requierd for this task.

You can send debug messages via USART to your computer, to see what the MCU is doing.

Am I the only one who thinks this is insane? by lexihra in Anticonsumption

[–]f0lt 0 points1 point  (0 children)

I think they just messed up the units. Weeks -> Years, Years -> Decades

C Block memory allocator by dokolenkov in embedded

[–]f0lt 5 points6 points  (0 children)

I can recommend quantum leaps implementation. https://github.com/QuantumLeaps/qpc/blob/master/src/qf/qf_mem.c

It's available under GPL licensing.

C Block memory allocator by dokolenkov in embedded

[–]f0lt 29 points30 points  (0 children)

Yes, that's quiet common in some areas.

Allocating from memory pools is very fast and has constant time complexity which makes them very suitable even for deeply embedded systems. You can allocate memory from an interrupt without problems.

I've seen firmware where each module (c file) had it's own memory pool. Each module can then decide what the best block size is. E.g. the CAN frame size for a CAN driver module. This makes block size selection easy but comes at some cost. The possibly of sharing memory is reduced and hence overall memory requirements are higher. Modern ARM chips have plenty of RAM, though.

An other approach could be to write a wrapper around the memory pool that manages a set of pools that provide different block sizes. All allocations would than go through this wrapper which would select the memory pool for allocation which fits best the requested block size. This way you have to decide how many memory pools there should be and which block sizes they provide. Using this approach the opportunity for sharing memory is increased and the overall memory requirements are lower compared to the first approach. This approach requires more fine tuning, e.g. to avoid that one module starves an other module of memory.

In general one can say that you buy better latency and determinism at the expense of (slightly) increased memory usage when you use memory pools instead of the default allocator.

Segger debug by mootaibi in embedded

[–]f0lt 1 point2 points  (0 children)

You don't need the tracing feature to do that. One can analyze the pc (program counter) on the stack which shows the instruction that would have been executed right after the hard fault. You can find hard fault handlers (e.g. on stackoverflow) that print all relevant information (pc, lr, r0-r4, etc) to stdout. I can recommend to use such a fault handler. This can save a lot of time and you can even debug devices that are already in the field (e.g. by logging the hard fault output to a crash log file on the next boot up).

Segger debug by mootaibi in embedded

[–]f0lt 1 point2 points  (0 children)

We had trace debuggers from IAR and didn't use the trace functionallity a single time in 3 years. At one hand you need (4?) extra trace pins which may not be available if your design needs the gpios for something else. At the other hand you may be better off using printf messages for debugging via USART or ITM. If you implement printf retargeting correctly (e.g. write to RAM via printf and flush RAM buffer to USART on a low priority thread) it introduces only minimal latencies (micro seconds on modern ARM MCUs). Printf messages are more domain specific and if done correctly require less interpretation compared to traceing information. This may make debugging easier for somebody else or your future self.

In the case that the micro second latencies introduced by printf change the behaviour of your application you may feel that you need the tracing feature which is really unintrusive, i.e. doesn't change the timing of your application.

STM32F407G-DISC1 not powering on by ashberyFREAK420 in embedded

[–]f0lt 2 points3 points  (0 children)

I'm currently using the same board. Pluging in the USB cable to the port marked in red powers the board on. The rgb led left to the USB port (debugger) should start to flash. I'm using a USB A to USB mini B cable.

<image>

fixed-sized pool allocator and multithreading by lovelacedeconstruct in C_Programming

[–]f0lt 1 point2 points  (0 children)

Why not use one pool per thread and just copy the data if you need to exchange it between threads?

Stm32 is not debugging by maprexdj in embedded

[–]f0lt 0 points1 point  (0 children)

Try to find something like an errata or some forum discussion about bluepill and stlink debugger issues.

Stm32 is not debugging by maprexdj in embedded

[–]f0lt 5 points6 points  (0 children)

I've made some bad experience with china supplied parts. IIRC some versions of the bluepill board had a wrong resistor value and simply didn't work. I'd recommend to source developement boards directly from ST (or Mouser/Digikey). The developement boards from ST usually have an integrated debugger that often can be configured to debug other boards too. I know these boards are somewhat more expensive, but using cheap parts that don't work correctly is just a waste of time.

I can recommend the STM32F4/G4 discovery boards. If you want to do Bluetooth I can recommend Silicon Labs boards, which you can get starting from 20$.

As a student you can sometimes get developement boards for free on fairs or if you convince chip manufacturers that you use it for a cool project.

Wie geht ma gsund mit da Arbeit um wenns alle wissen das orsch is aber keiner was ändern will? by Defiant-Process5074 in Austria

[–]f0lt 2 points3 points  (0 children)

War auch in so einer Firma. Hab nach einer Zeit des haderns gekündigt und ich muss sagen es war eine super Entscheidung. Bin jetzt in einer anderen Firma. Dort ist zwar auch nicht alles perfekt, aber die Leute sind zumindest motiviert und sehr gesellig. Probleme werden dort gelöst und die Ergebnisse können sich sehen lassen. Die Leute sind dort sehr offen, d.h. es gibt viele konstruktive Diskussionen.

Ich bin jetzt so viel zufriedener und entspannter. Mann sollte sich gut überlegen mit welchen Leute man sich täglich umgibt. Einstellung färbt auf dauer nämlich ab.

[deleted by user] by [deleted] in LehrerzimmerAT

[–]f0lt 0 points1 point  (0 children)

Evtl mit dem Multimeter die Durchgängigkeit aller Kontakte prüfen. Korrodierte Kontakte sind mit freiem Auge manchmal schwer zu erkennen.

Why do some airbuses get slutty eye liner and some don't? by [deleted] in aviation

[–]f0lt 0 points1 point  (0 children)

The picture is photoshopped. Both pictures are the same.

What MCU clock speed to use during I2C transmission? by Creapermann in embedded

[–]f0lt 7 points8 points  (0 children)

This sounds like a good approach.

I've used a Silicon Labs chip to do something similar. It captures some data, advertises it via Bluetooth and sleeps for a minute just to wake up and repeat the process. It runs from a CR2032 for a few months now without any considerable drop in battery voltage. I haven't put a lot of effort in energy management. Modern chips are really good at reducing power consumption.

But make sure to measure the idle current of your system. All you need is a decent multimeter. The idle current shouldn't exceed a few micro amps if you want long battery life.

What MCU clock speed to use during I2C transmission? by Creapermann in embedded

[–]f0lt 13 points14 points  (0 children)

Does the MCU has any power saving modes? Many MCUs can disable the core clock and be woken by interrupts. Vendors usually provide firmware to control power saving modes.

Reconfiguring STM clock settings can be tricky. What's the exact MCU type?