Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
* Code clean-up/refactoring
* Support both USB and UART communication with host
  • Loading branch information
mcoracin committed Jun 9, 2017
1 parent 3a869d6 commit c803f10
Show file tree
Hide file tree
Showing 26 changed files with 8,429 additions and 5,862 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
Binary file removed bin/PGW.dfu
Binary file not shown.
3,235 changes: 0 additions & 3,235 deletions bin/Pgw.hex

This file was deleted.

3,086 changes: 3,086 additions & 0 deletions bin/pgw_fw_uart.hex

Large diffs are not rendered by default.

Binary file added bin/pgw_fw_usb.dfu
Binary file not shown.
3,186 changes: 3,186 additions & 0 deletions bin/pgw_fw_usb.hex

Large diffs are not rendered by default.

108 changes: 89 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2017 Semtech-Cycleo

LoRa Pico Cell Gateway project
==============================
LoRa Pico Cell Gateway project - MCU firmware
=============================================

1. Components
-------------

## 1. Components
----------------

This directory contains the sources code of the Keil project to build a Picocell
Gateway MCU firmware based on the Semtech LoRa Picocell Gateway reference
design.
The target MCU is a STM32F401CD. The firmware implements an USB CDC protocol to
bridge commands coming from host to the SX1308 SPI interface.
The target MCU is a STM32F401CD. The firmware implements either a USB CDC
protocol or a UART protocol to bridge commands coming from host to the SX1308
SPI interface.
The embedded firmware takes in charge the power management of the SX1308 during
the downlink to respect the 500MA max power constraint in the USB plug.

Expand All @@ -27,8 +29,8 @@ the downlink to respect the 500MA max power constraint in the USB plug.
|+--+-----------+ +------+| xxx xxx | |
|| | | || xx Internet xx | |
|| Pico Cell GW |<----+ Host |<-----xx or xx------>| |
|| STM32F401CD | USB | || xx Intranet xx | Server |
|| Sx1308 | +------+| xxx xxx | |
|| STM32F401CD | USB/| || xx Intranet xx | Server |
|| Sx1308 | UART+------+| xxx xxx | |
|| 2*SX1257 | Linux | xxxxxxxxxxxx | |
|+--------------+ | | |
| | +--------+
Expand All @@ -39,11 +41,11 @@ the downlink to respect the 500MA max power constraint in the USB plug.
### 1.1. MAIN ###

The MAIN/ directory contains the main program that runs on the MCU, which
launches the USB command interpreters to communicate with the Host.
launches the USB/UART commands interpreter to communicate with the Host.

### 1.2. CmdUSB ###

The CmdUSB/ directory contains the USB command interpreter to handle the
The CmdUSB/ directory contains the USB/UART command interpreter to handle the
communication between the Host and the concentrator. It is a bridge to the HAL
which communicates with the SX1308 through SPI.

Expand All @@ -56,25 +58,93 @@ The STM32 USB CDC library modified for this reference design.
The LoRa concentrator Hardware Abstraction Layer C library to configure the
hardware, send and receive packets.

2. Precompiled binaries
-----------------------

## 2. Precompiled binaries
--------------------------

The bin/ directory contains the precompiled binary files in .hex or .dfu
formats.
To load the binary file into the STM32F401CD target Mcu, use a tool like
DFU-UTIL : http://dfu-util.sourceforge.net/
formats, for both USB and UART communication bridges.
To load the binary file into the target MCU flash memory, you have to:

### 2.1. USB

* Make the MCU enter DFU mode:
- either press the BOOT0 button of the PicoCell GW while plugging it to the
host USB port
- or use the util_boot tool provided with the picoGW_hal repository.

* Program the binary into the MCU flash memory:
- use a tool like dfu-util (http://dfu-util.sourceforge.net).

ex:
```
dfu-util -a 0 -D pgw_fw_usb.dfu
```

Note: you may have to use sudo depending on your priviledges.

3. Changelog
-------------
* Unplug/replug USB PicoCell GW to exit DFU mode.


### 2.2. UART

* Make the MCU enter UART bootloader:
- either press the BOOT0 button of the PicoCell GW while plugging it to the
host USB port
- or use the util_boot tool provided with the picoGW_hal repository.

* Program the binary into the MCU flash memory:
- use a tool like stm32flash (https://sourceforge.net/projects/stm32flash)

ex:
```
stm32flash -b 115200 /dev/ttyS0 -v -w pgw_fw_uart.hex -g 0x0
```


## 3. Build the project
-----------------------

In order to compile the whole project, a Keil project is provided in the src/
directory. Open the pgw.uvproj file in Keil and rebuild all.

By default, it builds the project for using USB communication bridge. In order
to use the UART instead, uncomment the following line in src/MAIN/board.h before
building all the project.

```
#define USE_UART 1
```

After the compilation as succeeded, a Pgw.hex file is created in the bin/
directory. It is the file to be programmed in the MCU flash memory. Refer to
section 2 of this document to get information for flashing.
A DFU file can be created from this .hex file using the "Dfu file manager" tool
provided by STmicroelectronics.
[www.st.com/resource/en/user_manual/cd00155676.pdf](www.st.com/resource/en/user_manual/cd00155676.pdf)


## 4. User Guide
----------------

[A detailed PicoCell GW user guide is available here](http://www.semtech.com/images/datasheet/picocell_gateway_user_guide.pdf)


## 5. Changelog
---------------

### v0.1.0 ###

* Code clean-up, refactoring
* Support both USB and UART communication with host

### v0.0.1 ###

* Initial release


4. Legal notice
----------------
## 6. Legal notice
------------------

The information presented in this project documentation does not form part of
any quotation or contract, is believed to be accurate and reliable and may be
Expand Down
59 changes: 0 additions & 59 deletions src/CmdUSB/inc/CmdUSB.h

This file was deleted.

Loading

0 comments on commit c803f10

Please sign in to comment.