boochow / micropython-raspberrypi Goto Github PK
View Code? Open in Web Editor NEWbare metal Raspberry Pi Zero / Zero W port of MicroPython
License: MIT License
bare metal Raspberry Pi Zero / Zero W port of MicroPython
License: MIT License
Followed the instructions to the letter -- but stuck at the rainbow splash screen. Looks like
the kernel firmware.img has some problem...
I am building on the Ubuntu sub-system on Windows 10.
I see no error or warnings except this:
source/device/hid/keyboard.c: In function 'KeyboardAttach':
source/device/hid/keyboard.c:163:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (parse->Report[i]->Fields[j].Usage.Keyboard >= KeyboardLeftControl
^~
source/device/hid/keyboard.c:166:8: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
data->KeyFields[(u16)parse->Report[i]->Fields[j].Usage.Keyboard - (u16)KeyboardLeftControl] =
^~~~
LINK build/firmware.elf
make BOARD=RPI1
/bin/sh: 1: arm-none-eabi-gcc: not found
How to install virtualenv
https://gist.github.com/frfahim/73c0fad6350332cef7a653bcd762f08d
Getting Started
https://github.com/micropython/micropython/wiki/Getting-Started
Debian, Ubuntu, Mint, and variants
The following packages will need to be installed before you can compile and run MicroPython:
build-essential libreadline-dev libffi-dev git pkg-config (required at least in ubuntu 14.04) gcc-arm-none-eabi libnewlib-arm-none-eabi
Is this supposed to be functional? I've compiled the current branch and installed it as described in the readme. I have also tried the release distribution and I get the same result. Running on raspberry pi zero V1.3. I've tried raspbian and that works just fine so I know the board is at least functional. I had also tried the release about a year ago, uncommented the lines in main.py and was always presented with a bunch of random colors on the screen.
Here is a screenshot of the layout of my sd card.
This is the contents of main.py. Everything else remains unchanged.
from machine import Pin
led = Pin(47, Pin.OUT) # create output pin on GPIO47 (on-board LED)
led(0) # set pin to on/low
while True:
pass
I would expect the led to turn on and remain on. However, it blinks a couple times, turns off pauses and then quickly blinks and stays off. This appears to be the behavior when it fails to boot the .img
file.
Because some people say micropython only use 4MB of memory.
But pi zero has 64MB+ memory.
If your project cant allow us to use those memory, that will be a sad thing.
I'm trying to make it work but no success... Follow the instructions and just rainbow... help please
Hi boochow, this is great, thank you.
Did you think about going even lower and making it VC4 baremetal instead of ARM baremetal? There is gcc compiler for VC4 VPU and accessing peripherials should be very similar. There is example VPU firmware https://github.com/christinaa/rpi-open-firmware with serial console working that enables SDRAM, turns on ARM core and tries to boot linux there.
Then it would not need extra bootcode.bin and other closed stuff and would boot faster and could even draw less power if you don't enable ARM core at all. Maybe it could even fit into 128KB L2 SRAM where bootcode.bin is initially loaded so even 512MB SDRAM could be off for some use cases (or maybe not, 128KB may be too small for micropython, OTOH microbit has 128+16KB). Disadvantage of bare metal VC4 is not having easy HDMI out and all those VC4 mailbox api calls but the ARM core is free to do other stuff.
That would make this VERY useful. Could it be done?
I just tried micropython-raspberrypi on RP1 and it seems to work quite slow. The results from pystone_lowmem.py:
Pystone(1.2) time for 500 passes = 853ms
This machine benchmarks at 586 pystones/second
The result is compatible with a 64 MHz Cortex-M4 MCU, Has anyone performed similar testing ?
Hi. I tried run micropython on RPi 2B and sadly it does not work. There is possibility to force your project to do that?
Best regards.
Draqun
Hello, where can I see the REPL, on HDMI or on UART?
Also, I'm trying to run this repo on PI 4 B, will it work on that?
I have this error then I run "make BOARD=RPI1
":
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build/genhdr/qstr.i.last
GEN build/genhdr/qstr.split
GEN build/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
mkdir -p build/build/
mkdir -p build/extmod/
mkdir -p build/lib/embed/
mkdir -p build/lib/libc/
mkdir -p build/lib/libm/
mkdir -p build/lib/mp-readline/
mkdir -p build/lib/oofatfs/
mkdir -p build/lib/timeutils/
mkdir -p build/lib/utils/
mkdir -p build/py/
CC ../micropython/py/mpstate.c
In file included from ./mpconfigport.h:2,
from ../micropython/py/mpconfig.h:62,
from ../micropython/py/mpstate.h:31,
from ../micropython/py/mpstate.c:27:
./arm_exceptions.h:34:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs -only' [-Werror=attributes]
34 | extern void __attribute__((interrupt("UNDEF"))) undef_handler(void);
| ^~~~~~
./arm_exceptions.h:35:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs -only' [-Werror=attributes]
35 | extern void __attribute__((interrupt("SWI"))) svc_handler(void);
| ^~~~~~
./arm_exceptions.h:36:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs -only' [-Werror=attributes]
36 | extern void __attribute__((interrupt("ABORT"))) abort_handler(void);
| ^~~~~~
./arm_exceptions.h:37:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs -only' [-Werror=attributes]
37 | extern void __attribute__((interrupt("IRQ"))) irq_handler(void);
| ^~~~~~
./arm_exceptions.h:38:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs -only' [-Werror=attributes]
38 | extern void __attribute__((interrupt("FIQ"))) fiq_handler(void);
| ^~~~~~
cc1: all warnings being treated as errors
make: *** [../micropython/py/mkrules.mk:47: build/py/mpstate.o] Error 1
So... What is this? I have a two python files I need to run at the boot on a RPI zero w. Those files call i2c components. A multiplexor, 4 mcp, 1 htk1633 for LEDs and a LCD display. (And I need wifi)
Can I use micro python to make that work? (im currently using raspbian).
Regards
I installed micropython-raspberry on a Pi Zero. It also has python 3 installed. What is the command to run micropython-raspberry files? Probably this should be obvious to me but it might be good to add that detail to the README file.
Does micropython-raspberry do WiFi yet?
Thanks for your work to make this library. There are lots of libraries in micropython for microcontrollers but I haven't found any for Pi computers so you've filled a big gap.
I tested it on Raspberry Pi 2. It takes at least 1 minute to read a 750K file.
buf=open('testl.bin').read()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.