GithubHelp home page GithubHelp logo

kammce / sammy Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 26 KB

Sammy is a tool for managing SJSU-Dev2 firmware projects and to install external packages such as platforms and libraries.

License: Apache License 2.0

Python 92.41% Shell 7.59%

sammy's People

Contributors

evanugarte avatar kammce avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sammy's Issues

CI: Add `platform install` test

Test Procedure

  1. Execute sammy platform install verify that ~/SJSU-Dev2 exists
  2. Verify that ./setup was run by attempting to build ~/SJSU-Dev2/projects/hello_world
  3. Delete ~/SJSU-Dev2/, do not delete ~/.sjsu_dev2.mk location file.
  4. Run steps 1 to 3 again to verify that SJSU-Dev2 is reinstalled.

sammy list

Add sammy command to list available repos/packages

sammy build [target_name]

This will build the current project within the current directory. If target_name number is given, then the target_name's configuration files will be used for the build.

sammy project build-config

Allows the user/developer to configure the defines within the project_config.hpp file without needing to modify the file directly. This works by parsing the project.mk file for config symbols and their documentation and crating a terminal UI using something along the lines of ncurses that allows the user to select options. Similar to the Raspberry Pi raspi-config or the ESP32's menuconfig.

sammy project create-target target_name

This command allows the developer create a new build target. This build target will have its own unique set of configurations, platform selection and build flags compared to the others. This allows users to create a set of targets for a particular application that can span multiple platforms or simply the same platform but with different settings.

To facility this, a folder of targets/ will pop up in the project directory, and will include its own project_config.hpp and project.mk file. When a sammy build target_name or make application BUILD_TARGET=target_name is run, it will use those files.

sammy platform update

Usage and Behavior

Fresh Install

$ sammy platform update
Updating SJSU-Dev2 to current master...

<cd SJSU-Dev2>
<git push . origin/master:master>

Done.

More information about how git push . origin/master:master works can be found at
Update local master to remote master from another branch. It allows for updating master without checkout it out.

Already Updated

$ sammy platform update
SJSU-Dev2 is up to date.

sammy project start

This command will copy the projects/starter project from the platform to the location specified by the user.

Usage

$ sammy project start project-name
Starting new SJSU-Dev2 project in folder "project-name".

<create folder with the project name>
<copy contents of starter to project name folder>

Done.

Requirements

  • Requires project name
  • Fail if directory exists (prevents overwriting already made folders)

Flatten the projects command group

Move from sammy project start <project_name> to simply sammy start-project <project_name>
Move from sammy project install <lib> to simply sammy install <lib>

And so forth for the others.

sammy platform install

Usage and Behavior

Fresh Install

$ sammy platform install
This command will download and setup SJSU-Dev2 in your $HOME directory. The following tools configurations will be installed globally on your machine:
- <insert list here>
- Mention the creation of the .sjsu-dev2.mk file in $HOME after setup is complete

Would you like continue [Y/N]: y

<Cloning SJSU-Dev2 to $HOME>
<execute setup>

Already Installed

$ sammy platform install
< Evaluate the sjsu-dev2.mk and determine if the path and directory exist. >
SJSU-Dev2 is already installed on your machine. 
< Potentially add content regarding how to install a package or updating the repo >

CI: Add `project start` testing

Test Procedure

  1. Setup sammy platform install
  2. Create project by using sammy project start azer
  3. Verify that the azer directory exists
  4. Change into it and attempt to build the project using standard build application, should succeed.
  5. Create project by using sammy project start azer again, should fail as azer directory already exists.
  6. Create new project using sammy project start nabeel
  7. Change into it and attempt to build the project using standard build application, should succeed.

Add sammy to pypi

Add this project to the pypi repository.

Installation Process

python3 -m pip install sjsu-dev2-sammy

sammy debug

Add debugging support via OpenOCD and GDB (or some other custom debugger).

sammy debug /path/to/firmware.elf
sammy debug  --platform="stm32f10x" /path/to/firmware.elf 
sammy debug main.cpp

This will open an OpenOCD session along with GDB and dump the user into the GDB shell.
The platform will be deduced from the build directory path. Users can force their flavor of platform by using the --platform option
If a source file is given, an associated .elf file must have already been generated from a build command. If so, the associated .elf file will be found in the build directory and a debug session will be started.

sammy install <package>

Usage

Install library in locally project

sammy install <package>

Install library globally in SJSU-Dev2

sammy install -g <package>

Installation via github repo

sammy install http://github.com/package/package

Details

CI: Add `platform update` testing

Testing Procedure

  1. Setup: run sammy platform install
  2. Capture the current commit hash to save for later.
  3. sammy platform update and expect it to return that there is nothing to do. Check that the commit hash is the same as before.
  4. sammy platform update but this time, move the master head back 2 commits and save the commit hash. Ensure that the update results in a difference between the previous has and the current hash, and that the current has is equal to the saved hash in part 2.

sammy project app-config

Allows the user/developer to configure the defines within the project_config.hpp file without needing to modify the file directly. This works by parsing the config.hpp file for config symbols and their documentation and crating a terminal UI using something along the lines of ncurses that the allows the user to select options. Similar to the Raspberry Pi raspi-config or the ESP32's menuconfig.

sammy flash

Add the functionality of flashing a board to sammy.

Example

Lets say you are in projects/hello_world and you already built the lpc40xx binary.

  1. Sammy executed without any arguments will assume flashing by serial (not jtag)
  2. Sammy searches a build directory
  3. If found, Sammy finds all platform folders with a firmware.bin in them that support serial flashing (in this case only lpc17xx and lpc40xx)
  4. If there are multiple prompt user asking them which one to, if only 1 folder proceed to step 5
  5. Run nxpprog (We added a feature to nxpprog called lpc search where nxpprog probes each COM devices for a response and if it finds a valid response will flash the first device it finds)
  6. Device if flashed and we are good to go

Additional Requirements

see @kammce's helpful description:
image

sammy install requirements.txt

Install libraries based on a requirements.txt file. Syntax for the requirements.txt (or .yml) file have not been decided yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.