-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lora: Support RISC-V build, update to latest libtock-c and move to examples #432
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bb63394
lora: Build lora examples for RISC-V
alistair23 06e56cf
lora: be more conservative in build script
ppannuto 4f71dec
lora: Update to use the new libtock-c layout
alistair23 0d001a7
lora: Move from wip to examples
alistair23 a49f394
examples: lora: Use TockLibrary.mk
alistair23 7c7eece
RadioLib: Move to top level
alistair23 add52ff
RadioLib: Work around GCC bug
alistair23 3526569
TockLibrary.mk: Fixup formatting failures for RadioLib
alistair23 06c64b0
examples: lora: Remove cmake build option
alistair23 a2ec25e
examples: lora: Add example output
alistair23 207aba9
RadioLib: Use EXTERN_LIBS instead of Makefile paths
alistair23 b8ab66d
examples: lora: Use C++ reinterpret_cast
alistair23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
LIBNAME := RadioLib | ||
|
||
TOCK_USERLAND_BASE_DIR ?= .. | ||
|
||
$(LIBNAME)_DIR := $(TOCK_USERLAND_BASE_DIR)/$(LIBNAME) | ||
|
||
# We ideally want this: | ||
# $(LIBNAME)_SRCS := \ | ||
# $($(LIBNAME)_DIR)/$(LIBNAME)/src/Module.cpp \ | ||
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*.cpp) \ | ||
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*/*.cpp) \ | ||
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*/*/*.cpp) | ||
# | ||
# But due to this in the GCC arm binary in the CI: | ||
# | ||
# ``` | ||
# (insn 179 178 46 8 (set (reg:SI 3 r3 [168]) | ||
# (mem/u/c:SI (plus:SI (reg:SI 12 ip [169]) | ||
# (unspec:SI [ | ||
# (symbol_ref/u:SI ("*.LC1") [flags 0x2]) | ||
# ] UNSPEC_PIC_SYM)) [0 S4 A32])) "../../../RadioLib/src/modules/LR11x0/LR11x0.cpp":638:16 929 {*thumb1_movsi_insn} | ||
# (expr_list:REG_EQUAL (symbol_ref/u:SI ("*.LC1") [flags 0x2]) | ||
# (nil))) | ||
# during RTL pass: postreload | ||
# ../../../RadioLib/src/modules/LR11x0/LR11x0.cpp:650:1: internal compiler error: in extract_constrain_insn, at recog.c:2195 | ||
# ``` | ||
# | ||
# we need to drop LR11x0 | ||
$(LIBNAME)_SRCS := \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/utils/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/C*/.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/LL*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/RF*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/S*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/n*/*.cpp) \ | ||
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/protocols/*/*.cpp) \ | ||
|
||
include $(TOCK_USERLAND_BASE_DIR)/TockLibrary.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Include the core RadioLib headers | ||
override CPPFLAGS += -I$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/src | ||
|
||
# Include the Tock specific headers | ||
override CPPFLAGS += -I$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/examples/NonArduino/Tock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.PHONY: clean | ||
|
||
TOCK_USERLAND_BASE_DIR ?= ../ | ||
|
||
|
||
all: $(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/README.md | ||
|
||
clean:: | ||
rm -rf build | ||
|
||
# confirm RadioLib git submodule is checked out. | ||
$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/README.md: | ||
git submodule update --init -- $(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Makefile for user application | ||
|
||
# Specify this directory relative to the current application. | ||
TOCK_USERLAND_BASE_DIR = ../../.. | ||
|
||
# Which files to compile. | ||
CXX_SRCS := $(wildcard *.cc) | ||
|
||
# Use the libtock-c Make system | ||
EXTERN_LIBS += $(TOCK_USERLAND_BASE_DIR)/RadioLib | ||
|
||
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Sensor Receive | ||
============== | ||
|
||
This example builds an application to receiver sensor data. | ||
|
||
## Example Output | ||
|
||
The output should look something like this. | ||
|
||
Note that if the receive example is started before the transmit you will get | ||
-6 errors (RX_TIMEOUT) like below, as there is nothing to receive. | ||
|
||
``` | ||
Apollo3 chip revision: B | ||
Initialization complete. Entering main loop | ||
[SX1261] Initialising Radio ... | ||
success! | ||
[SX1261] Receiving... | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
failed, code -6 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
success!: Temp: 24047, Hum: 5966 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Makefile for user application | ||
|
||
# Specify this directory relative to the current application. | ||
TOCK_USERLAND_BASE_DIR = ../../.. | ||
|
||
# Which files to compile. | ||
CXX_SRCS := $(wildcard *.cc) | ||
|
||
# Use the libtock-c Make system | ||
EXTERN_LIBS += $(TOCK_USERLAND_BASE_DIR)/RadioLib | ||
|
||
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Sensor Transmitter | ||
================== | ||
|
||
This example builds an application to transmit sensor data. | ||
|
||
## Example Output | ||
|
||
The output should look something like this | ||
|
||
``` | ||
Apollo3 chip revision: B | ||
Initialization complete. Entering main loop | ||
[SX1261] Initialising Radio ... | ||
success! | ||
[SX1261] Transmitting 'Temp: 24047, Hum: 5966' | ||
success! | ||
[SX1261] Transmitting 'Temp: 24047, Hum: 5966' | ||
success! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule RadioLib
deleted from
0ef554
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9f7c65b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically when running the formatter in the CI, the submodules aren't cloned. So no SRCs are found as there are no wildcards.
This avoids that error.