Commit 106541dc authored by Reto Da Forno's avatar Reto Da Forno
Browse files

example files updated

parent 4895d895
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<testConf xmlns="http://www.flocklab.ethz.ch" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.flocklab.ethz.ch xml/flocklab.xsd">
<!-- General configuration -->
<generalConf>
<name>Hello World</name>
<description>
A hello world app for the DPP2 LoRa platform.
</description>
<scheduleAsap>
<durationSecs>120</durationSecs>
</scheduleAsap>
<emailResults>no</emailResults>
</generalConf>
<!-- Target configuration -->
<targetConf>
<obsIds>10</obsIds>
<voltage>3.3</voltage>
<embeddedImageId>Image_1</embeddedImageId>
</targetConf>
<!-- Serial Service configuration -->
<serialConf>
<obsIds>10</obsIds>
<baudrate>115200</baudrate>
</serialConf>
<!-- GPIO Tracing Service configuration -->
<gpioTracingConf>
<obsIds>10</obsIds>
<pins>LED1 INT1</pins>
</gpioTracingConf>
<!-- GPIO Actuation Service configuration -->
<!-- NOT YET AVAILABLE! -->
<!-- Power Profiling Service configuration -->
<powerProfilingConf>
<obsIds>10</obsIds>
<offset>10</offset>
<duration>10</duration>
</powerProfilingConf>
<embeddedImageConf>
<embeddedImageId>Image_1</embeddedImageId>
<name>Hello world</name>
<description>Hello world application for the DPP2 LoRa platform</description>
<platform>dpp2lora</platform>
<data>
</data>
</embeddedImageConf>
</testConf>
......@@ -23,7 +23,7 @@ import os.path
import serial
import serial.tools.list_ports
from intelhex import hex2bin
import stm32loader as stm32bl
from stm32loader.main import Stm32Loader
verify = False
......@@ -42,35 +42,25 @@ def getFirstPort(printPorts):
def programSTM32(fileName, serialPort):
global verify, invertBOOT0
loader = stm32bl.Stm32Loader()
stm32bl.VERBOSITY = 0
loader = Stm32Loader()
loader.verbosity = 0
loader.configuration['data_file'] = fileName
loader.configuration['port'] = serialPort
loader.configuration['baud'] = 115200
loader.configuration['parity'] = serial.PARITY_EVEN
loader.configuration['boot0_active_high'] = invertBOOT0
try:
loader.connect()
if loader.read_device_details() != 0x435:
print("invalid device ID")
return
loader.configuration['erase'] = True
print("erasing...")
loader.perform_commands()
loader.configuration['write'] = True
print("programming...")
loader.perform_commands()
print("programming OK")
loader.configuration['go_address'] = 0x08000000
if verify:
print("verifying...")
loader.configuration['verify'] = True
loader.perform_commands()
print("reset")
loader.reset()
finally:
pass
loader.configuration['family'] = 'L4'
loader.configuration['erase'] = True
loader.configuration['write'] = True
loader.configuration['verify'] = True
loader.configuration['go_address'] = 0x08000000
loader.configuration['hide_progress_bar'] = True
loader.connect()
loader.read_device_id()
if loader.stm32.get_id() != 0x435:
print("invalid device ID")
loader.perform_commands()
loader.reset()
if __name__ == "__main__":
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment