esp-hal icon indicating copy to clipboard operation
esp-hal copied to clipboard

Be explicit about the need to build using the `release` profile

Open jessebraham opened this issue 11 months ago • 3 comments

A handful of people over the last few weeks have reported problems while using the dev profile, which is to be expected (from my perspective, they have no way of knowing this of course).

We need to be explicit about this requirement, and further we should give justification (i.e. that dev can be orders of magnitude slower than release).

jessebraham avatar Mar 09 '24 14:03 jessebraham

Hey @jessebraham, We have run multiple tests, also checking for timing issues. It really surprised us that even simple register access seems to introduce ~1.5ms of delay. It totally makes sense that dev mode can introduce timing issues. Do you want to only document this for TWAI, or in a more general sense?

I can contribute some docs if you need any help on this issue :)

ndrscodes avatar Mar 10 '24 21:03 ndrscodes

I think we should make this more explicit in general. Probably mentioning it in several places (not in detail everywhere - having a good explanation in one place and link to that in other places is probably preferrable)

One thing that comes to my mind is https://docs.esp-rs.org/no_std-training/03_1_panic.html - I guess we should explain there, how to still get reasonable backtraces without using dev profile and also explain why in most cases dev profile should be avoided

Re-reading that chapter from the training might (by accident) suggest to use dev profile generally

bjoernQ avatar Mar 11 '24 08:03 bjoernQ

The chapter in the no-std training got some re-phrasing / additions: https://docs.esp-rs.org/no_std-training/03_1_panic.html

bjoernQ avatar Mar 25 '24 10:03 bjoernQ

Related: https://github.com/esp-rs/esp-hal/discussions/1408#discussioncomment-9041499

bjoernQ avatar Apr 08 '24 06:04 bjoernQ

Probably mentioning it in several places (not in detail everywhere - having a good explanation in one place and link to that in other places is probably preferrable)

Shall we make the "deep" explanation in the Rust on ESP book and then have brief warnings with a link to it in both trainings?

SergioGasquez avatar Apr 10 '24 17:04 SergioGasquez