Seandunlevy
Posts: 5
Joined: Tue Oct 02, 2012 5:35 pm

Pi 0, bare metal, embedded system

Mon Sep 12, 2016 12:58 pm

Hi,
I've been reading rather than posting but I have a growing interest that the Raspberry Pi 0 is almost ideal as an embedded system for an engine-management processor. The code can fit inside 32K if you really optimize for space. The important thing is that the tables required can be generated. 4 or 5 variables do change in a manner ideal to be stored as a wavelet. My only issue is that loading off the SDcard more than doubles the cost. I note that the GPU dumps 32K into the L2 cache. If I could put my code in their, it's VERY cheap indeed.
I'm not sure if the system uses a block of ROM or EEPROM since releasing and then discovering a problem that can't be fixed would prove very problematic... if not impossible. I've been programming in assembly language for over 30 years so I have literally converted the EIC code from 68000 (yep - it's popular) into a mixture of ARM, Thumb & CP15 on paper and It will fit in just over 30K. If I was comparing it to a system more people know, it's like LPC-10 but using wavelets.
It's just a thought. Enough space for a secure boot so that it isn't possible for anyone else to copy the work if it ever get's that far. EMS actually has flags like 'antilag' so that the turbo(s) are set up to spin all the time BUT not pumping anything. The GPIO pins are ideal for setting these items. If nothing else, we will see a 'PiCore EMS'.
Thank you for your time.
Sean

scotty101
Posts: 3750
Joined: Fri Jun 08, 2012 6:03 pm

Re: Pi 0, bare metal, embedded system

Mon Sep 12, 2016 2:10 pm

My thoughts.

1. The Pi Zero isn't available in large enough quantities to be worth your effort
2. This type of application would be much better suited to a powerful microcontroller rather than a Pi type System on Chip. (For example the 68000 series that you mentioned)
3. There is not programmable EEPROM/FLASH on board. You need to use the SD card however...
4. The Compute Module has a EMMC device on board rather than an SD card.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

W. H. Heydt
Posts: 11086
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi 0, bare metal, embedded system

Mon Sep 12, 2016 3:38 pm

5. L2 cache won't be preserved if power is removed (it is volatile memory).

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: Pi 0, bare metal, embedded system

Mon Sep 12, 2016 3:55 pm

I think he's referring to the space for the boot code. :?
I don't think that space is available.

Laurens

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Pi 0, bare metal, embedded system

Mon Sep 12, 2016 4:57 pm

Seandunlevy wrote:Hi,
I've been reading rather than posting but I have a growing interest that the Raspberry Pi 0 is almost ideal as an embedded system for an engine-management processor. The code can fit inside 32K if you really optimize for space.
What does an engine-management processor do? Are you talking about hard real time stuff like spark timing and fuel injection? Or are you just controlling those systems from some central one? If what you are doing isn't the first, I wonder why you are squishing things into 32K in the first place. And why you are writing them in assembly, notwithstanding that some folks claim that it is "easier".

jgreen71
Posts: 92
Joined: Wed May 01, 2013 12:29 pm
Location: Clarksville, IN

Re: Pi 0, bare metal, embedded system

Mon Sep 12, 2016 5:43 pm


Seandunlevy
Posts: 5
Joined: Tue Oct 02, 2012 5:35 pm

Re: Pi 0, bare metal, embedded system

Mon Sep 12, 2016 7:34 pm

I can only apologize for wasting peoples time - I should have searched more. My interest was sparked because the SoC allows for an 'alternate boot' according to Broadcom - in their manual. It has been explained and has now been shown. I shall proceed accordingly. BTW - Writing commercial games on a 1MHz 6510 C64 more or less precludes anything BUT assembly language as did the Color Gameboy with a whole 2Mhz 8080. I can only presume nobody bothers to optimize felide-constructors. Live & Learn.....

User avatar
Paeryn
Posts: 2744
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Pi 0, bare metal, embedded system

Mon Sep 12, 2016 9:24 pm

Seandunlevy wrote:I can only presume nobody bothers to optimize felide-constructors. Live & Learn.....
What's a felide constructor? Do you mean elide constructors (where a variable is initialised directly from a class constructor without creating a temporary and copying)? g++ can optimise those quite well. There's no such word as felide, the option name comes from elide meaning join together, merge.
She who travels light — forgot something.

User avatar
Gavinmc42
Posts: 4042
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi 0, bare metal, embedded system

Tue Sep 13, 2016 1:33 pm

Seandunlevy,

Have a look at Ultibo, ARM based real time stuff it why I am learning it.
viewtopic.php?f=72&t=134956

I think one of the Pi 3/Zero boot modes is SPI, SD card is just a fancy SPI.
The bootloader.bin can be up to 128KB but it is VC4 code.
start.elf is also VC4, kernel.bin is what Ultibo replaces currently and is ARM code.
This can be done in < 2secs.

It would be nice to use the VC4 for realtime control one day, it currently uses a ThreadX RTOS for the ARM/VC4 graphics/camera stuff(start_x.elf).
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Beginners”