Firmware for MCU on Arcade shields
Перейти к файлу
Michal Moskal adf72ced48 Update jd-c 2021-03-02 19:51:07 -08:00
.github/workflows Add automatic build 2021-03-02 18:33:02 -08:00
cmsis_core@96d6da4e25 Add official STM submodules 2020-12-18 17:37:42 +01:00
cmsis_device_f0@20e23a96fe Add official STM submodules 2020-12-18 17:37:42 +01:00
images Add some pictures 2020-12-18 17:19:39 +01:00
jacdac-c@5fe86f422d Update jd-c 2021-03-02 19:51:07 -08:00
scripts Initial import 2020-03-13 21:46:12 -07:00
src Sound seems to do something 2021-03-02 18:27:22 -08:00
stm32f0xx_hal_driver@5eeaad10dc Add official STM submodules 2020-12-18 17:37:42 +01:00
targets Set config to STM32F030C6 not C8 2020-12-21 16:08:52 +01:00
.clang-format Initial import 2020-03-13 21:46:12 -07:00
.gitignore Align build process with jacdac-stm32x0 2020-12-18 16:36:34 +01:00
.gitmodules Build against specified JD services 2021-02-23 15:18:23 -08:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-03-13 21:35:42 -07:00
LICENSE Initial LICENSE commit 2020-03-13 21:35:44 -07:00
Makefile Dummy impl of sound service for testing 2021-03-02 17:46:41 -08:00
README.md Add trademark notice 2021-01-14 11:59:05 +01:00
SECURITY.md Initial SECURITY.md commit 2020-03-13 21:35:43 -07:00
sample-Makefile.user More info on deployment; default to STLINK 2020-12-18 17:37:54 +01:00

README.md

MakeCode Arcade smart shield firmware

Firmware for shields with screen/buttons that enable MakeCode Arcade. The shield drives the screen (in particular it can bit-bang a 320x240 parallel connection screen).

This firmware is just an example. Shield manufactures can use it as a base for their own development.

More information on Arcade shield can be found at in the Arcade shield spec and in particular in the PDF schematic.

Building

You will need a Unix-like environment to build the firmware. On Windows, you can use Windows Subsystem for Linux or mingw32.

  • install arm-none-eabi-gcc (we've been using 9-2019-q4-major)
  • install openocd (optional when using Black Magic Probe)
  • install GNU Make
  • run make; you should get a successful build

Upon first run of make, a Makefile.user file will be created. You will want to adjust the settings in there - there are comments in there that should guide you through the process.

To deploy the firmware to a module you will need a debugger interface. You have three options:

  • Black Magic Probe; you can also re-program other debuggers with BMP firmware
  • a CMSIS-DAP debugger; we've been using Particle Debugger; make sure to disconnect micro:bit USB port from your computer when using this
  • an ST-LINK/V2 or one of its clones - this is the default setting You will want to set the right interface in Makefile.user.

First deployment

Head to main.c, uncomment call to show_test_screen(). Now deploy your program by running make run (or make r for short). You'll likely need to have micro:bit connected to the shield to close the power circuit. You should see vertical stripes on the screen.

Vertical stripes showing on the shield screen

If you don't:

  • make sure the screen is hardware-configured as 8-bit parallel (and not 16-bit or SPI)
  • make sure the screen is using pins D[17:10] for communication (IM3-0 are 1001); see Section 4. of ILI9341 datasheet
  • make sure it's an ILI9341 screen; if not you may need to edit ili9341.c file

Once you have the screen running, comment out show_test_screen() and deploy again. You now should be able to run Arcade games on the micro:bit.

Space destroyer game showing on the shield screen

Notable make targets

Other than the building/deployment targets, the following might be of note:

  • make gdb - run GDB debugger
  • make clean - clean (duh!)

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.