#![no_main]
#![no_std]
extern crate panic_halt;
use cortex_m_rt::entry;
use stm32l0::stm32l0x1;
use stm32l0xx_hal::{
pac,
use std::io;
#[derive(Copy, Clone, Debug)]
struct Record<'a> {
id: u16,
name: &'a str,
quantity: u16,
price: f32,
}
This tutorial will explain step by step how to build and deploy MicroPython on STM32F407xx and STM32F411CEU boards, using both DFU mode over USB, as well as SWD with ST-Link and OpenOCD in case you can't get the board into DFU mode (happened to me with the "black pill").
It should be applicable to other boards, such as the other "black pill" STM32F401, Nucleo boards etc., provided you can find an appropriate board definition to build.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As the code is intended for an STM32F0xx board, which requires the peripherals to be defined within the CS, | |
the idea was to have them globally accessible, wrapped in Mutex - RefCell containers. | |
This does not work for the Random Number Generator. Code: | |
static GRNG: Mutex<RefCell<Option<rand::rngs::small::SmallRng>>> = Mutex::new(RefCell::new(None)); | |
gives an error "module 'small' is private". | |
Ideas go go around this and solve the whole problem: three separate timer interrups. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this won't work, either: | |
# in flask_app: | |
from counter import counter_update, counter_display | |
@app.route('/counter/') | |
def counter(): |
NewerOlder