Pull Requests - bus pirate 5 firmware

New Pull Request: PR to fix some problems with the storage
phdussud/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

Bunch of fixes to fix the hand over of the file system changes between BP and the host (At least Windows).
Support for Windows device eject command.
After all file system object writes, the BP mass storage is ejected and re-inserted to force Windows to notice the changed storage.
By analyzing the USB MSC traffic between a well known Trenscend SD card reader I found out and implemented the correct sequence of SENSE CODEs to emit during ejection and insertion of a changed storage system.

Created by: phdussud

1 Like

New Pull Request: Update build.yaml
DangerousPrototypes/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

Do not fail fast … try to complete all builds even if one fails.

Temporarily remove windows-latest due to continued build failures.

Created by: henrygab

New Pull Request: Langauge selection options in language they represent
henrygab/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

  • Translation selection should be in language it represents

json2h.py

  • Prevent accidental translation of language selection text using regex (to avoid constant need to update this script).
  • Explicitly require Python 3.7 or higher
  • Warn about non-compliant identifiers
  • Tabs to spaces in generated .h files
  • Use functions to logically separate code portions
  • Provide progress output
  • output fixed-width key (also helps highlight overlong identifiers)

*.json

  • Remove unused key/value pairs. Generated .h files were unchanged, confirming non-use

Created by: henrygab

New Pull Request: Resolve PR issues and fix a deadlock issue introduced by the diskio_mutex
phdussud/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

Sorry if I am late. I addressed the PR issues and found a problem with the mutex i introduced.

Created by: phdussud

New Pull Request: sfud: Add M25P128
cpackham/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

Add the 16MB SPI-NOR M25P128. This chip doesn’t support SFDP so it needs to be looked up based on the RDID information.

The memory is organized as:

  • 16777216 bytes (8 bits each)
  • 64 sectors (2 Mbits, 262144 bytes each)
  • 65536 pages (256 bytes each).

Created by: cpackham

New Pull Request: Use accessor function for translated strings
henrygab/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

Resolves #112 - Use Accessor functions for translated strings

Created by: henrygab

New Pull Request: Added handling of host lock and release
phdussud/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

Based on a suggestion from HenryGab, this PR honors the SCSI lock / release

Created by: phdussud

New Pull Request: Safe strings phase 1
mbrugman67/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

This is the first phase of removing unsafe string functions as per Issue #98.

This change marks the sprintf() function as deprecated; as such, each usage will result in a compiler warning during build. This is only a warning, there will be no change to existing functionality in compiled objects or linked executables/artifacts. You may safely ignore these warnings in your build output.

Example warning:

[ 52%] Building C object CMakeFiles/bus_pirate5_rev10.dir/binmode/sump.c.obj
./BusPirate5-firmware/binmode/sump.c: In function 'sump_do_meta':
./BusPirate5-firmware/binmode/sump.c:146:5: warning: 'sprintf_' is deprecated [-Wdeprecated-declarations]
  146 |     sprintf(cpu, "RP2040 %uMhz", sysclk / ONE_MHZ);
      |     ^~~~~~~
In file included from /home/matty/data/BusPirate5-firmware/pirate.h:78,
                 from ./BusPirate5-firmware/binmode/sump.c:39:
./BusPirate5-firmware/printf-4.0.0/printf.h:90:17: note: declared here
   90 | #define sprintf sprintf_

(I hope this doesn’t make me the least popular contributor to the project :slightly_smiling_face: )

Over the next couple of weeks I will update the codebase to replace sprintf() with the safter snprintf() until all warnings are gone. After that, using sprintf() will result in a compile error instead of a warning to prevent accidental reintroduction.

Created by: mbrugman67

2 Likes

New Pull Request: Add code to break the host_lock after a second
phdussud/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

In response to the problem on Linux, I propose to break the host_lock after a second timeout.

Created by: phdussud

2 Likes

New Pull Request: Safe strings phase 2
mbrugman67/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

It was my intention to break this into a few smaller PRs, but the nature of the code and method dependencies in ui_statusbar.c didn’t really make that feasible.

So here’s the code with all sprintf() calls changed to snprintf(). There is also the marking of sprintf() with an attribute that will generate a compile error if it is used again. For example:

[  7%] Building C object CMakeFiles/bus_pirate5_rev10.dir/ui/ui_statusbar.c.obj
In file included from ./BusPirate5-firmware/pirate.h:78,
                 from ./BusPirate5-firmware/ui/ui_statusbar.c:4:
./BusPirate5-firmware/ui/ui_statusbar.c: In function 'ui_statusbar_info':
./BusPirate5-firmware/printf-4.0.0/printf.h:90:17: error: call to 'sprintf_' declared with attribute error: Use of sprintf() not allowed; please use snprintf() instead
   90 | #define sprintf sprintf_
./BusPirate5-firmware/ui/ui_statusbar.c:30:9: note: in expansion of macro 'sprintf'
   30 |         sprintf(buf, "stuff");
      |         ^~~~~~~
gmake[3]: *** [CMakeFiles/bus_pirate5_rev10.dir/build.make:1406: CMakeFiles/bus_pirate5_rev10.dir/ui/ui_statusbar.c.obj] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:1857: CMakeFiles/bus_pirate5_rev10.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1864: CMakeFiles/bus_pirate5_rev10.dir/rule] Error 2
gmake: *** [Makefile:150: bus_pirate5_rev10] Error 2

The developer should see the line error: call to 'sprintf_' declared with attribute error: Use of sprintf() not allowed; please use snprintf() instead and realize they need to use the safer method.

Created by: mbrugman67

3 Likes

New Pull Request: DO NOT MERGE - Storage architecture working branch
henrygab/BusPirate5-firmwareDangerousPrototypes/BusPirate5-firmware

UNTESTED - For early review and comments only.

Created by: henrygab