!YoLPkieCYHGzdjUhOK:matrix.org

Embassy

377 Members
Welcome to the Embassy matrix channel! -- Next-gen async embedded Rust framework -- https://embassy.dev -- https://github.com/embassy-rs/embassy33 Servers

Load older messages


SenderMessageTime
27 Jan 2023
@dirbaio:matrix.orgdirbaioopt-level=3 tends to generate bigger code, which is not the right tradeoff with the tiny flash caches in mcus22:48:17
@dirbaio:matrix.orgdirbaiooh and of course enable the flash cache 22:49:12
@dirbaio:matrix.orgdirbaio

something like

    pac::FLASH.acr().modify(|w| {
        w.set_dcen(true);
        w.set_icen(true);
        w.set_prften(true);
    });
22:49:22
@dirbaio:matrix.orgdirbaio(assuming the f0 has one)22:49:35
@dirbaio:matrix.orgdirbaio overflow checks sounds like it's not inlining something that would allow optimizing it away. Perhaps we're missing some #[inline] in embassy-stm32. Try building with LTO, which should allow inlining regardless. 22:50:44
@slushee:community.rsSlushee joined the room.23:02:35
@joshmcguigan__:matrix.orgJosh McguiganThanks for the tips! I've noted them down and I'll give them a shot this weekend sometime. In the meantime, I am successfully/smoothly controlling the brushless motor based on back emf now!23:21:57
@dirbaio:matrix.orgdirbaioit'd be cool if RCC default was "as fast as possible"23:23:03
@dirbaio:matrix.orgdirbaioinstead of some silly default like 8mhz... 23:23:08
@joshmcguigan__:matrix.orgJosh Mcguiganyeah agreed, is there some technical reason that is hard to do ?23:23:23
@dirbaio:matrix.orgdirbaio * instead of some silly slow freq like 8mhz... 23:23:26
@dirbaio:matrix.orgdirbaioit's just hard, the limits and what config to use to reach them vary a lot between chips23:23:54
@dirbaio:matrix.orgdirbaioand I think sometimes HSE is mandatory to go fast? or to have good precision for stuff like USB23:24:46
@dirbaio:matrix.orgdirbaioand you don't know which HSE is fitted on the board if any, so guessing will cause things to not work at all23:25:13
@joshmcguigan__:matrix.orgJosh Mcguiganwhat actually happens when I configure rcc to use 48mhz rather than 8? does the controller just start looking at a different clock source, or does it physically/electrically modify a clock source to meet the configured speed, or something else? 23:29:02
@dirbaio:matrix.orgdirbaioa lot of stuff 😅23:29:34
@dirbaio:matrix.orgdirbaioread the RCC chapter of the reference manual for the full stuff23:30:11
@dirbaio:matrix.orgdirbaio

the tldr is:

  • the hardware has a few clock sources (HSI = on-chip oscillator, typically 8mhz or 16mhz. HSE = external quartz crystal, frequency is whatever you mount on the PCB)
  • it can multiply/divide using some black magic (the PLL) to get faster clocks
  • it can then choose one of these for several clocks (system clock, periphral clocks...)
23:32:42
@dirbaio:matrix.orgdirbaiorcc defaults to HSI unless you set rcc.hse=Some(..)23:33:10
@dirbaio:matrix.orgdirbaioso that's doing something like grabbing HSI then configuring the PLL to multiply by 6, then use that as sysclk23:33:43
@joshmcguigan__:matrix.orgJosh Mcguigancool, I've gotta run for now, but thanks again for the help!23:35:55
@dirbaio:matrix.orgdirbaiothat's what I do when I have to do RCC stuff as well23:36:26
@dirbaio:matrix.orgdirbaiorun23:36:27
@dirbaio:matrix.orgdirbaio😂23:36:28
@dirbaio:matrix.orgdirbaiorun away23:36:50
@iot49:matrix.orgiot49 Is is possible to run the embassy-executor in a standard *nix (I use macos) enveronment? Would be mostly for developing stuff that does not do chip-level io. 23:47:17
@dirbaio:matrix.orgdirbaioyup! https://github.com/embassy-rs/embassy/tree/master/examples/std/src/bin23:48:05
28 Jan 2023
@iot49:matrix.orgiot49

Thanks, this worked. But upon going back to my nrf52840 repo (in a different directory), I suddenly get tons of compiler errors about std, even though my main includes #![no_std] as the first line (I also have not changed it since compiling another app for x86).

error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7em-none-eabihf` target may not support the standard library
  = note: `std` is required by `critical_section` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

I feel like an idiot. But this is really weird.

02:20:35
@iot49:matrix.orgiot49I did find the issue.02:46:34
@9names:matrix.org9nameswhat was it?02:48:42

There are no newer messages yet.


Back to Room List