Skip to content

STM32: Espruino Pico #2596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 7, 2020
Merged

STM32: Espruino Pico #2596

merged 6 commits into from
Feb 7, 2020

Conversation

hierophect
Copy link
Collaborator

@hierophect hierophect commented Feb 6, 2020

This PR adds support for the Espruino Pico board (Adafruit Link). This board normally runs a javascript interpreter and is updated via a bootloader over a web interface - because Circuitpython depends more on the internal filesystem, this bootloader is not supported and you MUST use the built in F4 ROM bootloader included on all ST chips. This process is documented in the boards/espruino_pico/README.md file.

@hierophect
Copy link
Collaborator Author

@tannewt need PID for this when you have a sec.

@hierophect hierophect requested review from ladyada and tannewt February 6, 2020 16:50
@ladyada
Copy link
Member

ladyada commented Feb 6, 2020

Espruino Pico     VID 0x239A    PID 0x008D  # bootloader
                                PID 0x808D  # arduino
                                PID 0x808E  # circuitpython

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much of the flash does the Espruino bootloader take up?

@hierophect
Copy link
Collaborator Author

hierophect commented Feb 6, 2020

@tannewt the bootloader always takes at least 16KB (one sector) because it can't overwrite itself. If you put the ISR flash after that it leaves only 32KB for the whole filesystem (and it might take even more in the Espruino case, it was kind of hard to tell from their code). It also isn't super well documented how to upload your own binaries with it, since it's designed for use with their online IDE. I don't think it'd be any easier for new users to use it rather than the DFU option, as compared to a UF2 bootloader.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it makes to do since the ISRs and bootloader take that much up. I was thinking Espruino owners probably know how to use their Web IDE so it'd be easiest for them. If you still want to do DFU instead, then feel free to merge.

@hierophect
Copy link
Collaborator Author

I'm not an Espruino pro so I could be wrong, but if any come along and think there's a way to get around this, then it'd be easily revisited.

@hierophect hierophect merged commit b93d6e8 into adafruit:master Feb 7, 2020
@ladyada
Copy link
Member

ladyada commented Feb 7, 2020

@hierophect and/or @makermelissa - add these to circuitpy.org next please :)

@makermelissa
Copy link
Collaborator

Done. PR is adafruit/circuitpython-org#404

@ladyada
Copy link
Member

ladyada commented Feb 9, 2020

did a lil hardware test - just checks the button and LEDs

import time
import board
from digitalio import DigitalInOut, Direction, Pull

led1 = DigitalInOut(board.LED1)
led1.direction = Direction.OUTPUT
led2 = DigitalInOut(board.LED2)
led2.direction = Direction.OUTPUT
switch = DigitalInOut(board.BTN)
switch.direction = Direction.INPUT
switch.pull = Pull.DOWN

while True:
    if switch.value:
        led1.value = False
        led2.value = True
    else:
        led1.value = True
        led2.value = False

    time.sleep(0.01)  # debounce delay

@hierophect hierophect added the stm label Feb 29, 2020
@hierophect hierophect deleted the stm32-espruino-pico branch February 29, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants