RTEMS Tools | feat: Rewrite rtems-bin2c.c in python (!74)

Joel Sherrill (@joel) gitlab at rtems.org
Wed Nov 19 18:04:41 UTC 2025




Joel Sherrill commented: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/74#note_136121


> The only difference is how the new script handles the `-C` and `-H` arguments. I have added an explanation here:

Reading the C version, it appears that it can create both .c and .h files with one command invocation. Having both arguments is valid behaviour.

https://gitlab.rtems.org/rtems/tools/rtems-tools/-/blob/main/misc/bin2c/rtems-bin2c.c?ref_type=heads#L165

The usage from the C version does not reflect what the program actually does. 

```
$ ~/rtems-work/tools/next/bin/rtems-bin2c -?
usage: bin2c [-csvzCH] [-N name] [-A alignment] [-l license_file] <input_file> <output_file>
  <input_file> is the binary file to convert
  <output_file> should not have a .c or .h extension

  -c - do NOT use const in declaration
  -s - do use static in declaration
  -v - verbose
  -z - add zero terminator
  -H - create c-header only
  -C - create c-source file only
  -N - force name of data array
  -A - add alignment - parameter can be a hexadecimal or decimal number
  -l - <license_file> - add the specified file as a license header
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/74#note_136121
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20251119/a01543bc/attachment.htm>


More information about the bugs mailing list