Age | Commit message (Collapse) | Author |
|
Some serial ports do not support specific baudrates or we are maybe not
interested in testing certain baudrate when running the fuzzing test.
Allow the user to pass multiple baudrates as a cli argument and have the
script randomly pick one of the baudrates while fuzz testing.
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
Tiger v1.1 has the UPDI lanes cut by default unless
ATtiny_GATE_CONTROL_d (GPIO0_C4) is pulled high.
Let's toggle that GPIO before flashing so that the UPDI can go through
to the ATtiny.
Since that GPIO was used for UART0 in Tiger v1.0, it is not supported
anymore (but those were engineering samples anyway).
Relates-to: TIGR-192
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Using "serial.rs485" api, the "_set_rs485_mode" callback of serialposix
is not triggered when "rs485_mode" property is updated since its setter
is overridden, making the "serial.rs485" a self-standing emulation for rs485.
Since we already have a kernel emulation for half duplex rs485, we should
make use of it by calling the respective ioctls to enable/disable it when
required.
Explicitly call "_set_rs485_mode" by passing "serial.rs485.RS485Settings"
(enable) or None (disable) instead of setting this property.
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
Similar to commit 040de5bcc ("testing: serial: test-serial: fix test size
"), also unidirectional mode must use the local "size variable"
Fixes: 040de5bcc ("testing: serial: test-serial: fix test size ")
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
The test size can be randomized if the fuzz option is used and min/max
size are passed as cli arguments. The value holding the final test size
is a local variable ("size").
Pass it as argument to the transfer function instead of the cli argument.
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
|
|
Provide clear instructions for Debian users to lower the barrier of
entry.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Provide clear instructions for Debian users to lower the barrier of
entry.
Relates-to: RNG-175
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
package
The unofficial pure-Python gpiod package was replaced by
C-bindings-based official gpiod Python package on Pypi and the former is
deprecated.
c.f. https://pypi.org/project/gpiod/
"""
Versions 1.5.4 and prior are the deprecated, unofficial, pure-Python
bindings.
"""
While this isn't necessarily something we should worry about in the
short term, it turns out that distros actually do not package the
pure-Python, so this makes it less easy to install the dependencies for
i2c_flash.py. We could support v1.6.3 gpiod to be able to install it
from Debian package feed, however v1.6.x is in maintenance-only state
and v2.x is actively being developed with additional features, so let's
just play it safe and migrate to v2.x version.
We bump the requirements to the latest available version so that it uses
the C-bindings-based official implementation hosted on Pypi.
See https://github.com/hhk7734/python3-gpiod/issues/39 for the
discussions and history behind gpiod on Pypi.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Script for flashing mule-attiny FW on Jaguar and Tiger with a
minimal intervention from end-user.
Usage: ./mule-attiny.sh --flash [<firmware]
--flash <firmware> - flash the given firmware
Relates-to : JAG-103
Signed-off-by: Iskander Amara <iskander.amara@theobroma-systems.com>
|
|
Everything in place to use meson exclusively and we can finally remove the
Makefile.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
|
|
As we now have a meson build file we need to describe it in the README.
Because we now have an install target remove the ./ prefix of the usage
examples.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
|
|
Instead of doing Makefile magic we could use a modern build system like
meson. This commits tries to replicate the features of the current
Makefile.
To build:
# create build directory
meson build
meson compile -C build
As an alternative you can also change to the build dir and do a meson
compile.
Test reset Makefile target was implemented as a unittest
meson test -C build
As meson really does not want you to use environment variables in its
definitions you can only pass a complete environment to an external
command. To not add a wrapper script I decided to add build options.
Currently the GPIOs are set to match Ringneck.
To change the settings (for example Jaguar) use:
meson configure build -Drst_gpio_idx=13 -Drst_gpiochip_idx=2
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
|
|
Let's run shellcheck on all our current and future shell scripts so we
can catch mistakes before they reach users.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Testing serial is quite useful especially since we've had some issues
with RS232 and RS485 already, so let's add a Python script that is
nicely configurable to test many different scenarios.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Executing make will not rebuild the target in case a file has changed
unless the target depend on these files.
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
Puma Haikou Video Demo adapter DTS actually has a model name which
starts with "Theobroma Systems RK3399-Q7 SoM" but isn't exactly this
string, therefore the match needs to be extended to include Puma Haikou
Video Demo adapter DTS.
c.f. https://git.theobroma-systems.com/puma-linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou-video-demo.dts#n13
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
The flashing tool is now able to retrieve bootloader data. Let's make
the user capable of just reading these information through the console
without having to flash anything.
Relates-to: RNG-147
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
After entering the flashloader mode, clearing the boot request gpio
sets the flashloader into read-only mode where the flashing tool can read
bootloader data through i2c (i2c-write ops are ignored).
This data contain:
* Bootloader version
This tool will print out all bootloader data to the console.
Relates-to: RNG-147
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
After entering the flashloader it is safe to set it into read-only mode
(by pulling the boot request gpio back low) until the fw_flash() routine
is actually called. This avoids having any i2c process, by mistake, write
to the wire (flash unwanted/invalid data).
Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
|
|
Explicitly state what modules are supported by openocd.cfg config file
to avoid confusion.
Relates-to: RNG-10
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
|
|
Some exotic character was placed at the end of the sentence instead
of dot.
Relates-to: RNG-10
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
|
|
openocd.cfg is no longer placed in tools directory. Adjust manual
to include correct path.
Relates-to: RNG-10
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
|
|
Describe shortly what can be found in mule directory.
Relates-to: RNG-10
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
|
|
Add subsection with a list of dependencies required by mule.sh script.
Relates-to: RNG-10
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
|
|
This adds a pipeline for using linters. Only flake8 is used for now.
alpine/flake8 doesn't start a shell but rather execute flake8 directly.
However, GitLab CI seems to start all containers by trying to start a
shell:
```
-c if [ -x /usr/local/bin/bash ]; then
exec /usr/local/bin/bash
elif [ -x /usr/bin/bash ]; then
exec /usr/bin/bash
elif [ -x /bin/bash ]; then
exec /bin/bash
elif [ -x /usr/local/bin/sh ]; then
exec /usr/local/bin/sh
elif [ -x /usr/bin/sh ]; then
exec /usr/bin/sh
elif [ -x /bin/sh ]; then
exec /bin/sh
elif [ -x /busybox/sh ]; then
exec /busybox/sh
else
echo shell not found
exit 1
fi
```
Since flake8 is the entrypoint, it gets passed this long string which it
cannot do anything with (as opposed to the - I guess - expected `sh`).
Instead, let's replace the entrypoint of the docker image so that the
runner directly passes the script to the container.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
or 'if cond:'
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
time.sleep is used but the time module was never imported, so let's fix
that.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
The wrong variable names were used for comparison so let's use the
proper ones.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Take the one from i2c-flash copied during the import and make it the git
repository's wide policy.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
Minor change of a typo noticed during usage
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
|
|
We should really use argparse, but for now improve the usability
by printing the usage help when there is no command provided.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
|
|
As we are now also support a SBC (Jaguar) the use of the term baseboard
is wrong. Instead be more generic with just board.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
|
|
SBC-RK3588-AMR Jaguar is controllable over CP2102 both for its main
power and BIOS DISABLE lines, so let's add a wrapper script to make it
easier to control the BIOS Disable line state as well as control power
reset via USB.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
The biosdisable command was mistakenly setting the mode to normal
instead of BIOS_DISABLE, let's fix this.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
This change enables support for PX30-µQ7 SoM model.
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
|
|
Since `updi_reset` is an executable that needs to be compiled by the
user, it's better to explicit it should be made available to the user so
that it can be run as any executable, by having it installed in one of
the PATH directories or extend `PATH` environment variable to contain
the `updi_reset` executable's parent directory.
Reported-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
flake8 reports an issue:
E275 missing whitespace after keyword
So let's fix it by adding the missing whitespace.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
This makes a new console script called `mule-attiny_i2c_flash` available
to the user after installing the package which calls the `main` function
from the i2c_flash package.
Users now just need to call mule-attiny_i2c_flash from anywhere on their
system to flash the Mule-ATtiny companion microcontroller over I2C.
Relates-to: EHSW-1799
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
To prepare for making setuptools create a console script for executing
the main code, let's put the main code into a function, lazily called
`main`.
To still allow users to run this script manually, make it call the main
function in that event,
Relates-to: EHSW-1799
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
This should allow for easier integration with build systems such as the
Yocto Project or Buildroot.
The LICENSE file is a copy of the MIT license file already at the root
of the git repository, only with the copyright year changed to this
year.
At the same time, a README is added to explain what this is useful for.
Relates-to: EHSW-1799
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|
|
This is an import from
https://gitlab.lan/som/mule-attiny/-/tree/4d0bd1eb6e739c82b82443776cd2a612d2bf2d1a/bootloader/utils/scripts/
with a directory rename to `i2c-flash`.
Relates-to: EHSW-1799
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
|