crownstone / crownstone-microapp

Crownstone microapp. Contains several examples and library to communicate with bluenet.
Apache License 2.0
2 stars 6 forks source link

Remove unnecessary dependencies #6

Open mrquincle opened 3 years ago

mrquincle commented 3 years ago

There's just for building the microapp a dependency on python, worse, there's a dependency on a particular python script:

make                        
Compile without firmware header
Traceback (most recent call last):
  File "scripts/microapp_make.py", line 9, in <module>
    from MicroappBinaryHeaderPacket import MicroappBinaryHeaderPacket
  File "/home/anne/workspace/crownstone-microapp/scripts/MicroappBinaryHeaderPacket.py", line 2, in <module>
    from crownstone_core.util.BufferFiller import BufferFiller
ModuleNotFoundError: No module named 'crownstone_core.util.BufferFiller'
make: *** [Makefile:22: build/example.elf.tmp] Error 1

This dependency should be removed. It is fine that there is a way to upload microapps using python, but to just compile the microapps, there should be no dependency on python scripts or pip packages.

mrquincle commented 3 years ago

The branch https://github.com/crownstone/crownstone-microapp/tree/srec_cat/scripts/srec_cat contains all manipulations using a combination of srecord and other command line tools such as dd or cut to create a proper header. This means that you can run the compiler/linker only once and then do the manipulations afterwards without having to run it another time. In platform.io or with the arduino sdk you might actually benefit from some scripting to do so. A python script (that is independent of the bluenet libs) would be much easier to write and maintain than the bash scripts in the scripts/srec_cat directory of this branch.

Calculating the CRC in python itself is already available in CRC.py.