85 Commits

Author SHA1 Message Date
Alex Duchesne
5bbb4e5a1c rg_tool: Allow specifying no .fw format if the target doesn't support any. 2025-01-11 20:10:06 -05:00
Alex Duchesne
3dbcfcd177 rg_tool: Only rebuild the bootloader if necessary 2025-01-08 14:01:40 -05:00
Alex Duchesne
aedb0969fc rg_tool: Create dummy partition table to avoid build failures on larger apps
The default partition table has a 1M partition for the app and there is an option for a 1.5M. If the app binary ends up being larger, the build will fail.

Now rg_tool.py will create a dummy partition table with a 3M partition which should allow all builds to succeed.
2024-10-19 13:39:49 -04:00
Alex Duchesne
2f3e9941e2 Improved cmake info output 2024-08-24 15:31:09 -04:00
Alex Duchesne
35622ca4e4 Updated .gitignore 2024-08-23 14:57:22 -04:00
Alex Duchesne
55be9c1c60 rg_tool: define IDF_PATH at the top
Doesn't change anything but we might as well query it only once.
2024-08-02 16:14:37 -04:00
Alex Duchesne
717ec23157 rg_tool: Define absolute paths to all tools on Windows
This is the only reliable way I found to get it to work well across all esp-idf versions in both powershell and command.

Windows is very annoying...
2024-08-02 15:39:17 -04:00
Alex Duchesne
d23fba3e44 rg_tool: Fixed not working correctly on Windows with esp-idf 4.4
esp-idf 4.4 does some fancy powershell stuff instead of adding commands to the PATH:

````
function idf.py { &python "$IDF_PATH\tools\idf.py" $args }
function espefuse.py { &python "$IDF_PATH\components\esptool_py\esptool\espefuse.py" $args }
function espsecure.py { &python "$IDF_PATH\components\esptool_py\esptool\espsecure.py" $args }
function otatool.py { &python "$IDF_PATH\components\app_update\otatool.py" $args }
function parttool.py { &python "$IDF_PATH\components\partition_table\parttool.py" $args }
````

`subprocess.run`'s subshell can't see or run those.
2024-08-02 15:04:30 -04:00
Alex Duchesne
d335fc5f59 rg_tool: Pass output file path to build_firmware, build_image 2024-07-29 20:58:00 -04:00
Alex Duchesne
cbdbc89be8 rg_tool: fatsize can be a string 2024-07-29 20:45:39 -04:00
Alex Duchesne
43ccfba757 rg_tool: Respect port and baudrate in new install command 2024-07-29 20:38:22 -04:00
Alex Duchesne
4c9969a158 rg_tool: Added install command to build and flash an entire image
It might be best to have commands to flash just the bootloader or partition table but this was easier to implement for now...
2024-07-29 20:22:49 -04:00
Alex Duchesne
bcebe67863 rg_tool: Fixed args.fatsize used instead of fatsize 2024-07-29 19:50:01 -04:00
Alex Duchesne
7ceefba72a rg_tool: Define all tool paths at the start of the script (#146)
All the tools we execute are now defined at the start of the script and can be overridden if needed.

It also defines the absolute path to gen_esp32part.py which seems to be missing in some environments.
2024-07-29 19:34:05 -04:00
Alex Duchesne
7dbf9f0786 rg_tool: Removed the custom serial monitor with custom address decoding
The profiling hasn't worked in a while and the serial causes issues on some setup.

Let's let esp-idf handle all of that through idf_monitor.py.

Deliberately not using `idf.py monitor` because it has some very slow preamble stuff going on.
2024-07-28 13:27:07 -04:00
Alex Duchesne
a9809e414c rg_system: Replaced RG_BUILD_TYPE with RG_BUILD_RELEASE
Release or not is all we care about. Any more nuance is controlled by other flags.
2024-07-01 14:14:33 -04:00
Tom Van Braeckel
d2ccfd366e
rg_tool.py: add optional --fatsize argument (#120)
* rg_tool.py: add optional --fatsize argument

This optional argument adds a FAT storage partition of the provided
size (500K, 5M,...) to the built image, with the label 'vfs'.
2024-06-29 14:06:34 -04:00
Alex Duchesne
bd29478993 Moved GITHUB_RELEASES_URL from the launcher to retro-go's config.h so targets can override it 2024-03-18 18:34:38 -04:00
Alex Duchesne
feb56553d3 mkfw: Fixed permissions 2024-01-30 18:48:02 -05:00
Alex Duchesne
2280e2955a rg_tool: Only use shell=True on Windows
Apparently when shell=True we can't reliably pass a list to subprocess.run
2024-01-30 18:42:35 -05:00
Alex Duchesne
c02aa30ac3 Attempt to fix github actions #3 2024-01-30 17:22:23 -05:00
Alex Duchesne
08c19bc0e0 Use CMake variables instead of environment
That way idf.py will trigger a rebuild when flags change.
2024-01-29 17:09:39 -05:00
Alex Duchesne
7972751f27 rg_tool: cleanup 2024-01-24 13:24:55 -05:00
Alex Duchesne
b69dcd90d4 rg_tool: Whitespace 2024-01-23 20:17:11 -05:00
Alex Duchesne
a85bcf7b19 rg_display: Moved lcd init sequence to the target's config.h
Initially I thought displays would be used on many devices, but clearly every device has a different one.

So it's better to keep the sequence in the target/config.h in order to avoid modifying rg_display.c all the time.
2024-01-23 19:46:22 -05:00
Alex Duchesne
59f5e4280d rg_tool: Show device's partition table when flashing 2024-01-23 17:28:21 -05:00
Alex Duchesne
217d0cf0a2 rg_tool: Trap KeyboardInterrupt 2024-01-23 17:21:00 -05:00
Alex Duchesne
68832ac355 rg_tool: Execute parttool.py instead of importing it
This solves path issues in some setups. It's also a bit faster because we can set `esptool.py` options such as --chip.
2024-01-23 15:10:10 -05:00
Alex Duchesne
864c7a650f rg_tool: Do not patch binaries to disable sha256 check
The slightly faster boot times were nice but it's not very safe to go against esp-idf, especially that we support several chips with slightly different behaviors...
2024-01-23 14:01:12 -05:00
Alex Duchesne
e8cf4dafc5 rg_tool: Execute gen_esp32part.py instead of importing it
This solves path issues in some setups
2024-01-23 13:38:05 -05:00
Alex Duchesne
76b4c61758 rg_tool: Support for esp32s3 image generation
Image format is decided based on IDF_TARGET.

The environment variable IMG_FORMAT is also available to override this (which will be useful if we add multiple formats for a single target, eg esp32s3_uf2).
2024-01-23 12:19:10 -05:00
Alex Duchesne
1defc613c0 Fixed bootloader build step that I broke a few commits ago... 2024-01-18 16:14:30 -05:00
Alex Duchesne
746757aa58 Make CMake fill the current unix timestamp environment variable 2024-01-18 15:54:52 -05:00
Alex Duchesne
52020b4004 retro-go: Moved sdkconfig to the targets folder
Most targets have almost identical needs, but sometimes they differ.

So I think it's best to just maintain one sdkconfig file per target.
2024-01-13 15:15:16 -05:00
Alex Duchesne
7eaea136df retro-go: Added missing esplay-s3 target to config.h 2024-01-12 18:29:24 -05:00
Alex Duchesne
c9ca8a26e3 rg_tool.py: Renamed build.py to env.py, as they're used to set env, not build per se 2022-11-04 16:17:35 -04:00
Alex Duchesne
3a42a0cf20 Reorganized the targets folder to add more flexibility
It's now possible to run a python script to override or set some elements handled by rg_tool, such as .fw format, idf_target, etc.

This is not the definitive version. I think injecting python in rg_tool isn't "correct", it should export a structure or something...
2022-11-03 16:27:27 -04:00
Alex Duchesne
fb86799c45 rg_tool: Changed --with-networking to be --without-networking
rg_tool should reflect what my default builds do
2022-10-19 10:38:49 -04:00
Alex Duchesne
671e491c46 rg_tool: Added --idf-target to specify the target SOC
It makes it easier when experimenting but we should probably somehow have a way to specify idf-target in the rg target file..
2022-10-01 15:11:19 -04:00
Alex Duchesne
c26d56a407 Fixed building with networking 2022-10-01 14:57:57 -04:00
mtojek
ff4b1a310c
rg_tool.py: use python3 2022-08-29 17:57:17 +02:00
Alex Duchesne
f9f6454694 rg_tool: There's no need for a list of targets in the file
It scans targets/*.h either way.
2022-08-24 17:13:48 -04:00
32teeth
4e081ba7d4 created proper Retro ESP32 build deployment 2022-07-27 13:25:22 -04:00
Alex Duchesne
469fcaa91e Namespaced some build env variables
Some older (and mostly unused) environment variables weren't prefixed with RG_
2022-07-19 16:34:55 -04:00
Alex Duchesne
0773c7b4be rg_system: Save time to a separate file, instead of the settings
This could cause corruption of the settings file if the write was interrupted.
2022-07-18 14:40:51 -04:00
Alex Duchesne
25dab18c55 rg_tool: Add the launcher when trying to build an image that needs it*
* I was lazy and really the launcher will always be included.

To be fair, currently, only DOOM can work without the launcher...
2022-06-18 14:03:15 -04:00
Alex Duchesne
c4578e5640 Fixed compilation for other esp32 chips 2022-04-20 20:06:11 -04:00
Alex Duchesne
a8e2d2fa55 rg_tool: Added raw flash image output support
For simplicity I reverted to using a python file to define partitions. The csv would've been nice, allowing `idf.py partitiob-table` to work, but it's pointless if we ignore it and generate the table ourselves anyway (due to configurable apps list)...
2022-03-31 21:04:25 -04:00
Alex Duchesne
9ebb8e3a88 rg_tool: Removed unecessary options 2022-03-19 21:20:43 -04:00
Alex Duchesne
df7e17e981 rg_tool: Don't use folder name as project name
This causes some issues. I guess I'll have to add back rg_config.py...
2022-03-16 18:16:54 -04:00