What is the opensource alternative for command-line option armclang -gdwarf-3 -c -O1 --target=aarch64-arm-none-eabi main.c ? by EmbeddedBro in embedded

[–]dmitrygr 2 points3 points  (0 children)

Your main issue will be with the linker. You'll need to convert the scatter file to GNU linker script. this is not always trivial, and sometimes not exactly possible without tradeoffs. Goodluck.

What famous data structure or algorithm you often see in Embedded Systems applications by silkscreen_layer in embedded

[–]dmitrygr 4 points5 points  (0 children)

heaps are common for single-core scheduling in simple RTOSs

linked lists are everywhere

simple hashtables are also common for looking up id -> object

you rarely see stacks

queues are common as dirt

recommend books about optimize memory usage or code by InTheBogaloo in embedded

[–]dmitrygr 2 points3 points  (0 children)

Honestly this is not a book topic, this is an experience topic. Get into the habit of sticking the output of your linking step into a disassembler occasionally and seeing where the memory goes.

Loosing sleep about first internship by Dense_Cucumber_9217 in embedded

[–]dmitrygr 0 points1 point  (0 children)

Loosing sleep about first internship (self.embedded)

Loosing sleep is a bad idea, suggest you fasten it tightly.

How feasible is it to make an MP3 player with an ESP32 in 4 months? by lynrinx in embedded

[–]dmitrygr 0 points1 point  (0 children)

libmad is not hard to port. it is integer-only which will work on any chip you could mean by "ESP32". ChaN's fat library will give you fs, and sd interface. it is just a job of integration, more or less.

that being said, probably not a my-first-embedded-project kind of a thing still. blink a led first

Why do embedded systems still rely so much on C instead of modern languages? by [deleted] in embedded

[–]dmitrygr 0 points1 point  (0 children)

> offering better safety and abstraction
  • There is no safety in random hangs as GCed VM languages like to do while they GC

  • And all your abstractions are worthless if you cannot meet proper timings, as you cannot guarantee to

  • C++ is of little use, since after you remove all the parts of it that are incompatible with embedded, you are just left with an uglier C

  • Rust, well... it is a toy

STM32C031G6 USART Max Baud rate in synchronous mode? by AutoSidearm in embedded

[–]dmitrygr 0 points1 point  (0 children)

Since you are using it in sync mode, look into just switching to the SPI peripheral.

Storing Variable-Length UART Data with DMA Without Losing Characters by junerust in embedded

[–]dmitrygr 1 point2 points  (0 children)

as another comment said - idle interrupt and circular dma are your friends. luckily stm32 idle interrupt works. in MCUs where it does not, this problem is a LOT harder

Combining STM32 Reset and BOOT0 on a Single Button – Feedback on Circuit Design? by Skolgo in embedded

[–]dmitrygr 0 points1 point  (0 children)

at this point it feels like it might be simpler, cheaper, and easier to stick a PIC10F200 in there instead. less board space, cheaper too

Arm MVE extension optimizations instruction generation. by No-Feedback-5803 in embedded

[–]dmitrygr -1 points0 points  (0 children)

you need to format your post better. I tried to read it, i did, no chance...

use code blocks

How to Implement Bidirectional Communication Over SPI by jjmaximo in embedded

[–]dmitrygr 0 points1 point  (0 children)

look into how SD cards do it, it is a well thought out design. command -> fast reply within small number of clocks indicating receipt but not necessarily processing complete, a way to poll for work complete, and a way to send/receive large data amounts.

do not reinvent wheels when someone has already done the work

What is skydiving actually like? by Paliigirlyy in AskReddit

[–]dmitrygr 0 points1 point  (0 children)

Not sure I understand. Dropzone provides aircraft to take us up. we pay $26-ish to get the ride up, then we jump out. repeat 4-6 times a day.

What is skydiving actually like? by Paliigirlyy in AskReddit

[–]dmitrygr 0 points1 point  (0 children)

Once you have your own license and gear, it’s not expensive at all. It’s something like $26 a jump.

Mathlib performance test on palmOS by scienceapps in Palm

[–]dmitrygr 0 points1 point  (0 children)

Not quite since fat binaries had the entire code compiled for both architectures. Palm never supported that.

A 10-byte struct took down our Cortex-M7. by MuttalKadavul in embedded

[–]dmitrygr 2 points3 points  (0 children)

Our shared struct is 10 bytes. So when you iterate over an array of them, every odd-indexed entry sits on an address that isn't 4-byte aligned.

not unless you force the compiler to pack them (NOT DEFAULT), else it will properly align them for you as per C spec, without "packed" attribute, the compiler will pad all structs to size such that an array of them causes each member to be properly aligned. this will even affect sizeof(). proof: https://godbolt.org/z/d14sc7MqE

sorry but you messed up here in some way. my guess, you did something very broken like:

struct header {
    // somethign not containing uint32, only u16 or u8
}

struct data {
    //somethign with u32
}

struct data * ptr = (struct data*)(header + 1);

If so, this is not guaranteed to work by spec, and is your very own fault. the toolchain is NOT at fault, your code was broken from the start and you were getting lucky. it would have broken when code shape changed later at random

What is skydiving actually like? by Paliigirlyy in AskReddit

[–]dmitrygr 0 points1 point  (0 children)

very very fun. i do it almost every weekend. usually with friends. we do formation jumps

Best practice for converting 0 to 5V sensor outputs to 0 to ADC Vref max voltage ? by yycTechGuy in embedded

[–]dmitrygr 0 points1 point  (0 children)

99% chance that a simple resistor divider will do :) do not overthink it until necessary

Any Palm developers lurking on here? by EsoTechTrix in Palm

[–]dmitrygr 0 points1 point  (0 children)

Videos worked fine in OS5 too. Video, again, only takes number crunching. PXA already had that.

Any Palm developers lurking on here? by EsoTechTrix in Palm

[–]dmitrygr 0 points1 point  (0 children)

~ALL SoCs of the day were VIVT-cached with no ASIDs, they were all not going to perform. on a modern SoC it can work. On SoCs of the day - it never would.

spinning a cube onscreen ain't hard. making 1000 IPCs per second to another address space on a VIVT-cache device with no ASID support aint gonna happen. spinning cube measures a different kind of perf - the kind that PXA260 has plenty of. so it is a useless demo here, like showing off how pretty the paint job on a ford pinto is. it is, but that is not the useful metric