emhell: Embedded shell

[ bsd3, embedded, library, program ] [ Propose Tags ]

Tooling for register exploration using SVD files and GDB-MI or OpenOCD backends


[Skip to Readme]

Modules

  • EmHell
    • EmHell.Options
    • EmHell.Parsers
    • SVD
      • EmHell.SVD.Completion
      • EmHell.SVD.Manipulation
      • EmHell.SVD.Query
      • EmHell.SVD.Selector
    • EmHell.SigintHandler

Flags

Automatic Flags
NameDescriptionDefault
hgdb

Build hgdb

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.1.1.0
Change log CHANGELOG.md
Dependencies attoparsec, base (>=4 && <5), bytestring, data-default-class, data-svd (>=0.1.1), directory, emhell, haskeline, hgdbmi (>=0.3), hocd (>=0.1.2.0), lens, optparse-applicative, prettyprinter, prettyprinter-ansi-terminal, repline (>=0.4.0.0 && <0.5), text, transformers, unix [details]
License BSD-3-Clause
Copyright (c) 2020 sorki <srk@48.io>
Author sorki <srk@48.io>
Maintainer sorki <srk@48.io>
Category Embedded
Home page https://github.com/DistRap/emhell
Bug tracker https://github.com/DistRap/emhell/issues
Source repo head: git clone git://github.com/DistRap/emhell.git
Uploaded by srk at 2024-01-03T11:16:47Z
Distributions NixOS:0.1.1.0
Executables hocd, hgdb, emhell
Downloads 53 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2024-01-03 [all 2 reports]

Readme for emhell-0.1.1.0

[back to package description]

GitHub Workflow Status Hackage version Dependencies

emhell

Embedded development could be hell without a good tooling!

Applications

emhell

emhell is a SVD (System View Description) register browser

Commands

  • :set - Set register field (for example :set uart4.brr.div_mantissa = 0x123).

    Since emhell has no backend, it simply renders the altered register.

hocd

hocd is a register viewer utilizing OpenOCD as a backend using hocd

Commands

  • :set - Set register field (for example :set gpioa.odr.odr5 = 1).

    Alters current register value with hexadecimal field value and writes new register value to memory.

  • :halt - Halts target

  • :reset - Resets target

  • :resume - Resumes execution

  • :step - Single-steps target

  • :version - Print OpenOCD version

hgdb

hgdb is a register viewer and a GDB frontend, built on top hgdbmi

Inspecting registers

To use arm-none-eabi-gdb with BlackMagicProbe available via /dev/bmp launch hgdb in following manner

hgdb --arm --bmp /dev/bmp --svd stm32f407.svd

You can then inspect registers via REPL using their names (tab completion available) delimited by comma, e.g.

λ> scb.scr
Register SCR
- System Control Register
- Address 0xE000ED10 (including offset 0x10)

0000000004
0x00000004
0b00000000000000000000000000000100
0b0000 0000 0000 0000 0000 0000 0000 0000 0100
Bit 2 SLEEPDEEP


+-------+---------+-+---------+-----------+-+
|◦[26:0]|SEVONPEND|◦|SLEEPDEEP|SLEEPONEXIT|◦|
+-------+---------+-+---------+-----------+-+
|   0   |    0    |0|    1    |     0     |0|
+-------+---------+-+---------+-----------+-+

Command line options

  • -e | --ex behaves like gdb --ex
  • --svd specifies SVD file to load on start
  • --file can be used to load image to Gdb on start
  • -a | --arm to use arm-none-eabi-gdb
  • --bmp DEV for use with BlackMagicProbe over UART
  • --bmphosted HOST:PORT for use with PC hosted BlackMagicProbe (blackmagic_stlinkv2 binary)
  • --remotegdb HOST:PORT for use with remotely running GDB server over TCP (could be OpenOCD provided one)

For full list refer to hgdb --help

Commands

  • :set - Set register value (for example :set gpioa.odr.odr5 = 1).
  • :svd - Load SVD file, can be used instead of --svd arguments or to change current SVD file
  • :file - Load file to Gdb

All other REPL commands are forwarded to GDB as CLI input.

Build

Using Cabal

git clone https://github.com/DistRap/emhell
cabal build

Using Nix

nix-build

Notes

The interface is not final and will probably change. With more recent Gdb than currently available on distributions we could also do completion for function names and variables (requires -symbol-list-functions and -symbol-list-variables).

Demo

asciicast