Go to advanced search

by okenido
Thu Jun 11, 2020 11:19 am
Forum: Bare metal, Assembly language
Topic: System freezes - howto diagnose
Replies: 8
Views: 898

Re: System freezes - howto diagnose

I don't know specifically for your case but in my bare metal apps I had random crashes with IRQ/FIQ when I didnt saved/restored floating point registers in the interrupt handler (depends if you use these...).

What happens if you add some timeout to your while loop ? Does the program keeps running ?
by okenido
Sat Jun 06, 2020 12:13 am
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Re: Fail-safe firmware upgrades

Do you use FatFS like me ? It seems f_close() does the sync so it's not needed to call it manually
by okenido
Fri Jun 05, 2020 11:52 pm
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Re: Fail-safe firmware upgrades

I fear there is no 100% fail-safe software method against the SD card doing its wear leveling. Anyway for the files going with the firmware I replaced the direct overwrite with a temporary copy + move, it's already way better as the critical time window where things can go wrong is considerably redu...
by okenido
Fri Jun 05, 2020 4:48 pm
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Re: Fail-safe firmware upgrades

I'm only changing one byte from the file, leaving its size untouched so it should be fine to prevent corruptions (eg. kernel8.img => kernel9.img) However I'm not sure how to deal with the problem regarding the firmware file itself. Maybe I can simply add lots of zero bytes at the end, providing enou...
by okenido
Fri Jun 05, 2020 2:28 pm
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Re: Fail-safe firmware upgrades

* it's kernel parameter, not start_file
by okenido
Fri Jun 05, 2020 2:09 pm
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Re: Fail-safe firmware upgrades

Interesting I'll check that too - I was simply thinking about swapping between the two firmware files, then updating config.txt programatically after the write is completed, so any power loss simply leave the system working on the already existing firmware
by okenido
Fri Jun 05, 2020 1:22 pm
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Re: Fail-safe firmware upgrades

It seems start_file in config.txt would simply do what I need, i'll try that thanks
by okenido
Fri Jun 05, 2020 1:16 pm
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Re: Fail-safe firmware upgrades

I wasn't very clear sorry, the RPI isn't bricked but the device embedding it is (unless you tell the user to open his device which isn't very practical)
by okenido
Fri Jun 05, 2020 12:49 pm
Forum: General discussion
Topic: Fail-safe firmware upgrades
Replies: 16
Views: 589

Fail-safe firmware upgrades

Hi My RPI3B+ has a custom made firmware (with bare metal code), and the firmware can be upgraded via USB. When the upgrade happens, the kernel8.img file is copied from USB to the SD card. If a power loss occurs at this moment, the file can be corrupted and the device bricked. A common method to make...
by okenido
Wed May 13, 2020 4:52 pm
Forum: Bare metal, Assembly language
Topic: RPI3B+ I would like to make a game
Replies: 4
Views: 606

Re: RPI3B+ I would like to make a game

Initializing and reading from the SD card is quite a complicated task.
I'd suggest using a bare metal library first (like Circle) and looking how things are done, then you can decide to go the full assembly way or stay quite close to the metal but with a library.
by okenido
Sat May 09, 2020 7:08 pm
Forum: General discussion
Topic: Get your Pi to fight COVID-19
Replies: 188
Views: 11007

Re: Get your Pi to fight COVID-19

Covid is bad for humanity, but good for the planet
:o :shock: :? :P
by okenido
Sat May 09, 2020 3:13 pm
Forum: General discussion
Topic: GPU minimum frequency ? Safe undervoltage ?
Replies: 0
Views: 148

GPU minimum frequency ? Safe undervoltage ?

I'm using the raspberry with bare metal code, using a screen but doing only software rendering to the framebuffer. I'm trying to reduce the SoC heat as much as possible, so I underclocked the GPU and I get a few mW saving with everything still working. In config.txt : h264_freq_min=100 isp_freq_min=...
by okenido
Wed Apr 29, 2020 3:15 pm
Forum: Bare metal, Assembly language
Topic: Bare metal UART w/FIQ stops working
Replies: 3
Views: 402

Re: Bare metal UART w/FIQ stops working

Nailed it! I had a parallel processing that was modifying a variable that could be potentially used by another core. When it was modified at the wrong timing it accessed an array with an index of -1. That was causing the exception. Damn it sounds so dumb, but the symptoms made it super hard to find ...
by okenido
Wed Apr 29, 2020 12:36 pm
Forum: Bare metal, Assembly language
Topic: Bare metal UART w/FIQ stops working
Replies: 3
Views: 402

Re: Bare metal UART w/FIQ stops working

Thanks, I was able to somewhat locate the error because it triggered an exception (which was silently ignored because I had everything setup for a release) which in turn disabled the FIQ (found in Circle's exception handler). I have some code that is writing to an invalid memory location. It should ...
by okenido
Wed Apr 29, 2020 12:11 am
Forum: Bare metal, Assembly language
Topic: Bare metal UART w/FIQ stops working
Replies: 3
Views: 402

Bare metal UART w/FIQ stops working

I'm using the bare metal library Circle (https://github.com/rsta2/circle) for my project and i'm facing a weird problem. I have UART0 setup in FIQ mode to receive some serial data, with the provided class CSerialDevice which works fine in a minimal example (https://github.com/rsta2/circle/blob/maste...
by okenido
Wed Mar 04, 2020 11:56 am
Forum: Official Foundation Display
Topic: New Display - Cursor Jumps and Clicks all over the place
Replies: 25
Views: 13128

Re: New Display - Cursor Jumps and Clicks all over the place

I'm designing a product using the 7 inch display and i'm quite worried about this issue. My prototypes exhibited the same random clicks all over the place, sometimes after a few months of use. I'm not sure it's a product's fault since I damaged the corners of most of my prototypes, corners of this i...
by okenido
Mon Aug 12, 2019 2:04 pm
Forum: General discussion
Topic: Why moving to 64bit?
Replies: 273
Views: 38482

Re: Why moving to 64bit?

I think 64 bit is mostly worth it, you get double the NEON registers, that can improve performance drastically if the software is written to take advantage of it.
However an app that is constrained by memory bandwidth limits and doing zillions of pointer manipulation will probably suffer
by okenido
Fri Jul 19, 2019 11:44 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread. [I2S works]
Replies: 993
Views: 540857

Re: STICKY: The I2S sound thread.

Thanks that make sense, i'ill try that asap.

Learning by trial & error :P :ugeek:
by okenido
Fri Jul 19, 2019 11:36 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread. [I2S works]
Replies: 993
Views: 540857

Re: STICKY: The I2S sound thread.

Seems that I can only transfer the first 32 bits of the frame despite I set its length to 128. Or i'm missing something. Maybe the clock divider trick you explained is the only way to go
by okenido
Fri Jul 19, 2019 11:18 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread. [I2S works]
Replies: 993
Views: 540857

Re: STICKY: The I2S sound thread.

I use the raspberry in Master mode for the sake of simplicity ^^ I received my scope and it helped a lot. For some reason, chosing a Frame Sync Length (FSLEN) greater than the Frame Length (FLEN) causes LRCLK to stop working. However, I can get the 256 BCLK per LRCLK if I just increase both FLEN and...
by okenido
Thu Jul 18, 2019 6:05 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread. [I2S works]
Replies: 993
Views: 540857

Re: STICKY: The I2S sound thread.

Yeah it seems complicated. I've tried to run I2S at 192Khz to write four 48Khz frames, while slowing down Frame Sync Length by a factor of 4 (FSLEN register, I guess it controls LRCLK ? => broadcom datasheet p.131 https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Per...
by okenido
Thu Jul 18, 2019 2:16 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread. [I2S works]
Replies: 993
Views: 540857

Re: STICKY: The I2S sound thread.

I switched to an AD1934 DAC chip since it has integrated PLL and it works on the Raspberry Pi 3B+ ! Now I want to use TDM to get more than a single stereo output (up to 4 stereo outs on AD1934), so I setup my DAC in TDM mode and write the data like this : Ch1 L | Ch1 R | Ch2 L | Ch2R (two stereo 48k...
by okenido
Sun Jul 07, 2019 6:40 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: The I2S sound thread. [I2S works]
Replies: 993
Views: 540857

Re: STICKY: The I2S sound thread.

I made the clock on the Raspberry Pi gpio #4 (seemed the easiest solution to me) but it won't wake up the DAC, this is what I used in dt-blob.dts (took from a post on this forum) : // in pin_config section pin@p4 { function = "gp_clk"; termination = "no_pulling"; }; // GPCKL0 // in videocore section...

Go to advanced search