Skip to content
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

Demo STM32L0 support #30

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Demo STM32L0 support #30

wants to merge 3 commits into from

Conversation

karlp
Copy link
Contributor

@karlp karlp commented Oct 18, 2020

Just a demo really of targetting an M0+ part.

I don't actually have any use for this going forward, but I had 99% of the code done, so tested it at least, and thought I'd share it here if anyone else wants this sort of thing.

karlp added 3 commits October 18, 2020 22:49
This is the half page size, not the full page size.
It's also unused, so just drop it.

Signed-off-by: Karl Palsson <[email protected]>
On Cortex-M3 and up parts, this doesn't matter, but for M0/M0+, this is
required.

Signed-off-by: Karl Palsson <[email protected]>
Demonstration of an m0+ target, and the ease of porting.

Unfortunately, some internal library code uses a modulo operation, and
that pulls in software divide, and this blows out past the 8k assumed
bootloader size.  You can simply comment out

  webusb_setup(usbd_dev);
  winusb_setup(usbd_dev);

in dapboot.c and it will drop under 8k again, but's clearly not a viable
long term solution.
karlp added a commit to libopencm3/libopencm3 that referenced this pull request Nov 27, 2020
Tested on L1 and L0 using the "dapboot" project, see
devanlai/dapboot#27 for L1
and
devanlai/dapboot#30 for L0
karlp added a commit to libopencm3/libopencm3 that referenced this pull request Nov 28, 2020
Tested on L1 and L0 using the "dapboot" project, see
devanlai/dapboot#27 for L1
and
devanlai/dapboot#30 for L0
BOJIT pushed a commit to BOJIT/PlatformIO-libopencm3 that referenced this pull request Jan 30, 2021
Tested on L1 and L0 using the "dapboot" project, see
devanlai/dapboot#27 for L1
and
devanlai/dapboot#30 for L0
@blakesmith
Copy link

@karlp Thanks for sharing this! I'm working on a project that uses an STM32L053. I was surprised that the chip has a USB peripheral, but the built-in bootloader from STM can't do USB DFU like other STM parts I've used (STM32F042 for example).

Going to give this a try for the bootloader instead!

}

/* Include the common ld script. */
INCLUDE stm32l1/stm32l1-base.ld
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is wrong, but harmless, as the "base" file is actually the same "cortex-m-generic" file anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants