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

rj/itcm #322

Merged
merged 18 commits into from
May 28, 2021
Merged

rj/itcm #322

merged 18 commits into from
May 28, 2021

Conversation

jordens
Copy link
Member

@jordens jordens commented Mar 31, 2021

jordens added 2 commits March 29, 2021 17:34
needs newer fixed cortex-m-rt 0.6.13+unreleased
relevant? https://reviews.llvm.org/D81986
bors bot added a commit to rust-embedded/cortex-m-rt that referenced this pull request Apr 15, 2021
323: link.x.in: put most __[se] symbols back into sections r=adamgreig a=jordens

This puts most start/end address symbols back into the sections.

Only `__ebss` and `__edata` are kept outside their sections so that
potential user code with external libraries can inject stuff using
`INSERT AFTER .bss/.data` and profit from the .bss/.data zeroing/loading
mechanism. This also leads to the `__sbss` and `__veneer_base` symbols
having the right section type (bss is B not D in nm).

Also the trust zone start and end address are aligned to 32 bytes as per
the requirements. That section does cost up to 28 byte of padding at the end of FLASH due to
that alignment even if empty. But since flash is typically a multiple of 32 bytes and since the padding is at the end, there is no downside.

The .rodata start is kept free for the linker to allocate it after .text.
This enables users to inject sections between .text and .rodata and
removes the chance to get overlapping address errors. With this the
linker will by default place .rodata after .text as before.

This commit also adds and exposes a few more stable address start/end symbols
(__[se]uninit, __stext, __srodata) that are usefull for debugging and hooking
into.

See
#287 (comment)
for discussion of the issues and description of this compromise solution.

Tested:

* [x] [stm32h7 ITCM](quartiq/stabilizer#322)
* [x] [sgstubs](#323 (comment))
* [x] `INSERT AFTER` for bss/data still works (#323 (comment))

Topics:

* [x] `sgstubs` moved to be the last section in FLASH to minimize the impact of the 32 byte alignment. (Padding flash to 32 byte is considered benign.)
* [ ] `INSERT AFTER` with binutils ld doesn't work. But that's independent of these changes. This is the `sgstubs`-in `memory.x` use case. Currently the `sgstubs` section is kept in `link.x`.

Co-authored-by: Robert Jördens <[email protected]>
@jordens
Copy link
Member Author

jordens commented Apr 29, 2021

bors try

@bors
Copy link
Contributor

bors bot commented Apr 29, 2021

try

Merge conflict.

* master: (70 commits)
  Updating JSON syntax
  Updating trigger
  Adding bors timeout
  dual-iir: add some mqtt parameter docs
  changelog: spelling
  update lock
  let bors handle hitl
  prepare v0.5.0 release
  Updating code after review
  Adding comment, reverting change
  Adding sleep to HITL run
  Updating ping deadline
  Reverting unintended change
  Updating dependency revision
  Renaming interface to avoid confusion
  dual-iir: use InputPin re-export, rename digital_input
  Updating dependency
  dual-iir: add enable_hold, force_hold
  fix bench
  hardware: add digital input support
  ...
@jordens
Copy link
Member Author

jordens commented Apr 29, 2021

bors try

bors bot added a commit that referenced this pull request Apr 29, 2021
@bors
Copy link
Contributor

bors bot commented Apr 29, 2021

try

Build failed:

@jordens
Copy link
Member Author

jordens commented Apr 29, 2021

bors try

bors bot added a commit that referenced this pull request Apr 29, 2021
@bors
Copy link
Contributor

bors bot commented Apr 29, 2021

try

Build failed:

@jordens
Copy link
Member Author

jordens commented Apr 29, 2021

bors try

bors bot added a commit that referenced this pull request Apr 29, 2021
@bors
Copy link
Contributor

bors bot commented Apr 29, 2021

try

Build failed:

jordens added 2 commits May 10, 2021 12:09
* origin/master: (34 commits)
  Simplifying unit conversions
  Cleaning up conversion + comments
  Addressing review feedback
  Update src/hardware/dac.rs
  Renaming AdcSample -> AdcCode
  Updating float conversion
  Adding adc/dac code conversion utilities
  Simplifying settings lock
  Updating after review
  Updating delay
  Fixing merge
  Formatting
  Updating dependencies
  Fixing clippy
  Finalizing merge
  Merging lockin app functions
  Fixing system timer
  Fixing build, formatting
  Adding documentation
  Renaming files
  ...
@jordens
Copy link
Member Author

jordens commented May 10, 2021

bors try

bors bot added a commit that referenced this pull request May 10, 2021
@bors
Copy link
Contributor

bors bot commented May 10, 2021

try

Build succeeded:

* rj/log:
  refine panic handler and add some logging info
  hitl: kill probe-run cleanly
  set target-cpu=cortex-m7, MSRV 1.52.0, use probe-run
  README: document lockin, cleanup instructions, use probe-run
  CHANGELOG: update
  README: streamline docs a bit, add probe-run
  update hitl script
  remove rtt feature
  use rtt logging
  dsp/lowpass,lockin: const generics
jordens added 2 commits May 13, 2021 15:22
* origin/master:
  deps: fix rtt-logger->rtt-target, cleanup, bump cortex-m
  build(deps): bump embedded-hal from 0.2.4 to 0.2.5
  Bump rtt-target from 0.2.2 to 0.3.1
  Bump serde from 1.0.125 to 1.0.126
  remove unused dependencies
  remove unused dependencies
src/startup.S Outdated Show resolved Hide resolved
@jordens jordens marked this pull request as ready for review May 27, 2021 16:22
@jordens jordens requested a review from ryan-summers May 27, 2021 16:22
src/hardware/configuration.rs Outdated Show resolved Hide resolved
src/hardware/configuration.rs Outdated Show resolved Hide resolved
src/hardware/configuration.rs Show resolved Hide resolved
@jordens jordens requested a review from ryan-summers May 28, 2021 07:28
@jordens
Copy link
Member Author

jordens commented May 28, 2021

bors merge

bors bot added a commit that referenced this pull request May 28, 2021
322: rj/itcm r=jordens a=jordens

* close #315
* would profit from cortex-m-rtic 0.6 elevating the attributes to the actual ISR thus removing the veneer

Co-authored-by: Robert Jördens <[email protected]>
@jordens
Copy link
Member Author

jordens commented May 28, 2021

bors cancel

@jordens
Copy link
Member Author

jordens commented May 28, 2021

bors merge

@bors
Copy link
Contributor

bors bot commented May 28, 2021

Build succeeded:

@bors bors bot merged commit 9587088 into master May 28, 2021
@bors bors bot deleted the rj/itcm branch May 28, 2021 14:39
adamgreig pushed a commit to rust-embedded/cortex-m that referenced this pull request Jan 12, 2022
323: link.x.in: put most __[se] symbols back into sections r=adamgreig a=jordens

This puts most start/end address symbols back into the sections.

Only `__ebss` and `__edata` are kept outside their sections so that
potential user code with external libraries can inject stuff using
`INSERT AFTER .bss/.data` and profit from the .bss/.data zeroing/loading
mechanism. This also leads to the `__sbss` and `__veneer_base` symbols
having the right section type (bss is B not D in nm).

Also the trust zone start and end address are aligned to 32 bytes as per
the requirements. That section does cost up to 28 byte of padding at the end of FLASH due to
that alignment even if empty. But since flash is typically a multiple of 32 bytes and since the padding is at the end, there is no downside.

The .rodata start is kept free for the linker to allocate it after .text.
This enables users to inject sections between .text and .rodata and
removes the chance to get overlapping address errors. With this the
linker will by default place .rodata after .text as before.

This commit also adds and exposes a few more stable address start/end symbols
(__[se]uninit, __stext, __srodata) that are usefull for debugging and hooking
into.

See
rust-embedded/cortex-m-rt#287 (comment)
for discussion of the issues and description of this compromise solution.

Tested:

* [x] [stm32h7 ITCM](quartiq/stabilizer#322)
* [x] [sgstubs](rust-embedded/cortex-m-rt#323 (comment))
* [x] `INSERT AFTER` for bss/data still works (rust-embedded/cortex-m-rt#323 (comment))

Topics:

* [x] `sgstubs` moved to be the last section in FLASH to minimize the impact of the 32 byte alignment. (Padding flash to 32 byte is considered benign.)
* [ ] `INSERT AFTER` with binutils ld doesn't work. But that's independent of these changes. This is the `sgstubs`-in `memory.x` use case. Currently the `sgstubs` section is kept in `link.x`.

Co-authored-by: Robert Jördens <[email protected]>
@jordens jordens mentioned this pull request Jun 28, 2024
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.

Run process() task from ITCM
2 participants