www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - unusual bare metal target: Amazon Dash

reply "Laeeth Isharc" <spamnolaeeth nospamlaeeth.com> writes:
I don't know whether D can run on one, but from a quick look 
perhaps feasible.  Running D on something like this (perhaps it's 
underpowered, but looked to have similar spec to what people had 
been doing with related ARM cortex processors) would certainly 
make the point very vivid that it can be a bare metal programming 
language.

Only 1Mb of flash RAM for the program - is that enough?

https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/programming
https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/overview

The Amazon Dash button is a tiny device that orders products from 
Amazon.com at the press of a button.  It's designed to be put 
wherever you store consumeables like paper towels, trash bags, 
etc. so that you can easily order more when they run out.  The 
Dash is great at what it's designed to do, but did you know 
inside the Dash is a powerful ARM Cortex-M3 processor and WiFi 
module that are very similar to wireless development boards like 
the Particle Photon?  You'll even find there are easily 
accessible test pads on the Dash which allow you to reprogram its 
CPU and turn it into your own $5 internet button!  This guide 
will explore how to take apart the Dash and reprogram its CPU to 
run your own code.
...
The CPU is a STM32F205RG6 processor which is an ARM Cortex-M3 
that can run up to 120mhz and has 128 kilobytes of RAM and 1 
megabyte of flash memory for program storage.
The WiFi module is a BCM943362 module which in combination with 
the CPU make it a platform for Broadcom's WICED SDK.
There's a 16 megabit SPI flash ROM which is typically used in 
conjunction with the WICED SDK for storing application data.
An ADMP441 microphone is connected to the CPU and used by the 
Dash iOS application to configure the device using the speaker on 
a phone/tablet.
There's a single RGB LED and a button.
Aug 17 2015
next sibling parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 18/08/2015 1:32 p.m., Laeeth Isharc wrote:
 I don't know whether D can run on one, but from a quick look perhaps
 feasible.  Running D on something like this (perhaps it's underpowered,
 but looked to have similar spec to what people had been doing with
 related ARM cortex processors) would certainly make the point very vivid
 that it can be a bare metal programming language.

 Only 1Mb of flash RAM for the program - is that enough?

 https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/programming

 https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/overview


 The Amazon Dash button is a tiny device that orders products from
 Amazon.com at the press of a button.  It's designed to be put wherever
 you store consumeables like paper towels, trash bags, etc. so that you
 can easily order more when they run out.  The Dash is great at what it's
 designed to do, but did you know inside the Dash is a powerful ARM
 Cortex-M3 processor and WiFi module that are very similar to wireless
 development boards like the Particle Photon?  You'll even find there are
 easily accessible test pads on the Dash which allow you to reprogram its
 CPU and turn it into your own $5 internet button!  This guide will
 explore how to take apart the Dash and reprogram its CPU to run your own
 code.
 ...
 The CPU is a STM32F205RG6 processor which is an ARM Cortex-M3 that can
 run up to 120mhz and has 128 kilobytes of RAM and 1 megabyte of flash
 memory for program storage.
 The WiFi module is a BCM943362 module which in combination with the CPU
 make it a platform for Broadcom's WICED SDK.
 There's a 16 megabit SPI flash ROM which is typically used in
 conjunction with the WICED SDK for storing application data.
 An ADMP441 microphone is connected to the CPU and used by the Dash iOS
 application to configure the device using the speaker on a phone/tablet.
 There's a single RGB LED and a button.
By what you are saying, I believe it should be doable. Although I'm a little worried for the WiFi support. Do you need to include the code to drive it beyond wrap up some communication to it? 1mb flash should be enough to run D code on it. If you strip out a good percentage of druntime and definitely no Phobos. Although you may be able to mark and use some of that 16mb flash rom as executable code storage. If that's so, you'll be in a good place to have more then 1mb. It would require some clever runtime linking tricks however. I'm probably not the best person to go more in depth about it or the specific chips. So I won't. Most of my knowledge comes from reading what others says and talking with Jens Bauer.
Aug 17 2015
parent reply "Laeeth Isharc" <Laeeth.nospam nospam-laeeth.com> writes:
On Tuesday, 18 August 2015 at 04:36:49 UTC, Rikki Cattermole 
wrote:
 On 18/08/2015 1:32 p.m., Laeeth Isharc wrote:
 I don't know whether D can run on one, but from a quick look 
 perhaps
 feasible.  Running D on something like this (perhaps it's 
 underpowered,
 but looked to have similar spec to what people had been doing 
 with
 related ARM cortex processors) would certainly make the point 
 very vivid
 that it can be a bare metal programming language.

 Only 1Mb of flash RAM for the program - is that enough?

 https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/programming

 https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/overview


 The Amazon Dash button is a tiny device that orders products 
 from
 Amazon.com at the press of a button.  It's designed to be put 
 wherever
 you store consumeables like paper towels, trash bags, etc. so 
 that you
 can easily order more when they run out.  The Dash is great at 
 what it's
 designed to do, but did you know inside the Dash is a powerful 
 ARM
 Cortex-M3 processor and WiFi module that are very similar to 
 wireless
 development boards like the Particle Photon?  You'll even find 
 there are
 easily accessible test pads on the Dash which allow you to 
 reprogram its
 CPU and turn it into your own $5 internet button!  This guide 
 will
 explore how to take apart the Dash and reprogram its CPU to 
 run your own
 code.
 ...
 The CPU is a STM32F205RG6 processor which is an ARM Cortex-M3 
 that can
 run up to 120mhz and has 128 kilobytes of RAM and 1 megabyte 
 of flash
 memory for program storage.
 The WiFi module is a BCM943362 module which in combination 
 with the CPU
 make it a platform for Broadcom's WICED SDK.
 There's a 16 megabit SPI flash ROM which is typically used in
 conjunction with the WICED SDK for storing application data.
 An ADMP441 microphone is connected to the CPU and used by the 
 Dash iOS
 application to configure the device using the speaker on a 
 phone/tablet.
 There's a single RGB LED and a button.
By what you are saying, I believe it should be doable. Although I'm a little worried for the WiFi support. Do you need to include the code to drive it beyond wrap up some communication to it? 1mb flash should be enough to run D code on it. If you strip out a good percentage of druntime and definitely no Phobos. Although you may be able to mark and use some of that 16mb flash rom as executable code storage. If that's so, you'll be in a good place to have more then 1mb. It would require some clever runtime linking tricks however. I'm probably not the best person to go more in depth about it or the specific chips. So I won't. Most of my knowledge comes from reading what others says and talking with Jens Bauer.
I think its doable too. Nobody seems to have figured out the wifi yet - more at LED flashing stage. It's funny these wifi devices have microphones in them !
Aug 18 2015
parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 19/08/2015 3:24 a.m., Laeeth Isharc wrote:
 On Tuesday, 18 August 2015 at 04:36:49 UTC, Rikki Cattermole wrote:
 On 18/08/2015 1:32 p.m., Laeeth Isharc wrote:
 I don't know whether D can run on one, but from a quick look perhaps
 feasible.  Running D on something like this (perhaps it's underpowered,
 but looked to have similar spec to what people had been doing with
 related ARM cortex processors) would certainly make the point very vivid
 that it can be a bare metal programming language.

 Only 1Mb of flash RAM for the program - is that enough?

 https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/programming


 https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/overview



 The Amazon Dash button is a tiny device that orders products from
 Amazon.com at the press of a button.  It's designed to be put wherever
 you store consumeables like paper towels, trash bags, etc. so that you
 can easily order more when they run out.  The Dash is great at what it's
 designed to do, but did you know inside the Dash is a powerful ARM
 Cortex-M3 processor and WiFi module that are very similar to wireless
 development boards like the Particle Photon?  You'll even find there are
 easily accessible test pads on the Dash which allow you to reprogram its
 CPU and turn it into your own $5 internet button!  This guide will
 explore how to take apart the Dash and reprogram its CPU to run your own
 code.
 ...
 The CPU is a STM32F205RG6 processor which is an ARM Cortex-M3 that can
 run up to 120mhz and has 128 kilobytes of RAM and 1 megabyte of flash
 memory for program storage.
 The WiFi module is a BCM943362 module which in combination with the CPU
 make it a platform for Broadcom's WICED SDK.
 There's a 16 megabit SPI flash ROM which is typically used in
 conjunction with the WICED SDK for storing application data.
 An ADMP441 microphone is connected to the CPU and used by the Dash iOS
 application to configure the device using the speaker on a phone/tablet.
 There's a single RGB LED and a button.
By what you are saying, I believe it should be doable. Although I'm a little worried for the WiFi support. Do you need to include the code to drive it beyond wrap up some communication to it? 1mb flash should be enough to run D code on it. If you strip out a good percentage of druntime and definitely no Phobos. Although you may be able to mark and use some of that 16mb flash rom as executable code storage. If that's so, you'll be in a good place to have more then 1mb. It would require some clever runtime linking tricks however. I'm probably not the best person to go more in depth about it or the specific chips. So I won't. Most of my knowledge comes from reading what others says and talking with Jens Bauer.
I think its doable too. Nobody seems to have figured out the wifi yet - more at LED flashing stage. It's funny these wifi devices have microphones in them !
I was thinking about that. Maybe for speech recognition? Of course there is no way that device could actually analyze it.
Aug 18 2015
prev sibling parent reply "Mike" <none none.com> writes:
On Tuesday, 18 August 2015 at 01:32:13 UTC, Laeeth Isharc wrote:
 I don't know whether D can run on one, but from a quick look 
 perhaps feasible.  Running D on something like this (perhaps 
 it's underpowered, but looked to have similar spec to what 
 people had been doing with related ARM cortex processors) would 
 certainly make the point very vivid that it can be a bare metal 
 programming language.

 Only 1Mb of flash RAM for the program - is that enough?
Yes, with the right techniques. Everything one needs to get started is documented at http://wiki.dlang.org/Minimal_semihosted_ARM_Cortex-M_%22Hello_World%22 A more complete proof of concept on similar hardware can be found at https://github.com/JinShil/stm32f42_discovery_demo Mike
Aug 20 2015
parent "Laeeth Isharc" <Laeeth.nospam nospam-laeeth.com> writes:
On Thursday, 20 August 2015 at 09:08:02 UTC, Mike wrote:
 On Tuesday, 18 August 2015 at 01:32:13 UTC, Laeeth Isharc wrote:
 I don't know whether D can run on one, but from a quick look 
 perhaps feasible.  Running D on something like this (perhaps 
 it's underpowered, but looked to have similar spec to what 
 people had been doing with related ARM cortex processors) 
 would certainly make the point very vivid that it can be a 
 bare metal programming language.

 Only 1Mb of flash RAM for the program - is that enough?
Yes, with the right techniques. Everything one needs to get started is documented at http://wiki.dlang.org/Minimal_semihosted_ARM_Cortex-M_%22Hello_World%22 A more complete proof of concept on similar hardware can be found at https://github.com/JinShil/stm32f42_discovery_demo Mike
Thanks, Mike. I have a mind to do this when time just to make a point next time someone who has never used the language starts on about the GC... ;) Unfort without libraries to control wifi unit or ultrasound, that's of minimal value today, but I am sure someone will figure that out in time.
Aug 20 2015