Skip to content

Commit

Permalink
Selectable baudrate addition
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz-Juranek committed Aug 5, 2019
1 parent 06bc5b7 commit c730b8a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
15 changes: 14 additions & 1 deletion embedded/Src/slcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,27 @@ void slCanCheckCommand()
}
MX_USART1_UART_Init();
open_lin_hw_reset();
result = terminator;
break;

case 'B':
case 'b':
{
uint32_t temp;
parseHex(&line[1], 4, &temp);
lin_baund_rate = temp;
MX_USART1_UART_Init();
open_lin_hw_reset();
result = terminator;
break;
}
case 'F': // Read status flags
result = terminator;
break;
case 'V': // Get hardware version
{
slcanSetOutputChar('V');
slcanSetOutputAsHex(VERSION_HARDWARE_MAJOR);
// slcanSetOutputAsHex(VERSION_HARDWARE_MAJOR);
slcanSetOutputAsHex(VERSION_HARDWARE_MINOR);
result = terminator;
}
Expand Down
4 changes: 2 additions & 2 deletions embedded/Src/slcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "open_lin_hw.h"
#include "open_lin_slave_data_layer.h"

#define VERSION_FIRMWARE_MAJOR 1
#define VERSION_FIRMWARE_MINOR 5
#define VERSION_FIRMWARE_MAJOR 2
#define VERSION_FIRMWARE_MINOR 0

#define VERSION_HARDWARE_MAJOR 0
#define VERSION_HARDWARE_MINOR 1
Expand Down
20 changes: 20 additions & 0 deletions embedded/usb_upload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/python

import serial
import sys
import os
import time

print("send boot to serial")
try:
ser = serial.Serial(sys.argv[1]) # open serial port
ser.write(b'boot\n\r') # write a string
ser.close() # close port
except:
print("no serial named " + sys.argv[1])

time.sleep(0.5)

print("write software to DFU")
os.system('D:\Programy\STMicroelectronics\STM32CubeProgrammer\\bin\STM32_Programmer_CLI.exe -c port=usb1 -e all -d .\TrueSTUDIO\LUCEmbedded\Debug\LUCEmbedded.bin 0x08000000 -v -s')

0 comments on commit c730b8a

Please sign in to comment.