Commit 507f1d08 by Sebastian Renner

Can compile/run gapuino examples now

parent 7e8ccbfb
### Dirty fix for libmpfr version ## Steps to getting the GAP SDK run on Linux
`sudo ln -s /usr/lib/libmpfr.so.6 /usr/lib/libmpfr.so.4`
In general, follow this README: https://github.com/GreenWaves-Technologies/gap_sdk/blob/master/README.md
PLUS
### Fix the -Werror flag to make openocd compile
### udev rule for FTDI Comment this line in gap_sdk/tools/gap8-openocd
```
touch 90-ftdi_gapuino.rules `GCC_WARNINGS="${GCC_WARNINGS} -Werror"`
echo 'ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", GROUP="dialout"'> 90-ftdi_gapuino.rules
echo 'ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="0666", GROUP="dialout"'>> 90-ftdi_gapuino.rules ### Fix libmpfr version error
sudo mv 90-ftdi_gapuino.rules /etc/udev/rules.d/ `sudo ln -s /usr/lib/libmpfr.so.6 /usr/lib/libmpfr.so.4`
sudo udevadm control --reload-rules && sudo udevadm trigger
```
...@@ -12,6 +12,5 @@ ...@@ -12,6 +12,5 @@
platform = riscv_gap platform = riscv_gap
board = gapuino board = gapuino
framework = mbed framework = mbed
board_upload.boot_mode = jtag_hyper board_upload.boot_mode = jtag
board_upload.commands = reqloop ioloop start wait board_upload.commands = reqloop ioloop start wait
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
#include "uartp.h" #include "uartp.h"
#include "crypto_aead.h" #include "crypto_aead.h"
#include "mbed.h" #include "mbed.h"
#include "gap_common.h"
#include "cmsis.h"
#define MAX_BYTES 100 #define MAX_BYTES 100
#define CMDBUF_LEN 72 #define CMDBUF_LEN 72
static uint8_t cmdbuf[CMDBUF_LEN]; static uint8_t cmdbuf[CMDBUF_LEN];
#define CRYPTO_BUSY GPIO_A23 #define CRYPTO_BUSY GPIO_A21
Serial device(USBTX, USBRX); Serial device(USBTX, USBRX);
...@@ -24,6 +26,7 @@ int res = 0; ...@@ -24,6 +26,7 @@ int res = 0;
void setup(); void setup();
//void loop(); //void loop();
DigitalOut crypto_pin(CRYPTO_BUSY); DigitalOut crypto_pin(CRYPTO_BUSY);
#ifdef __cplusplus #ifdef __cplusplus
...@@ -54,6 +57,7 @@ void my_assert(bool b) { ...@@ -54,6 +57,7 @@ void my_assert(bool b) {
} }
void setup() { void setup() {
PORT_SetPinMux(PORTA, 35, uPORT_MuxGPIO);
device.baud(115200); device.baud(115200);
crypto_pin = 1; crypto_pin = 1;
wait(100); wait(100);
...@@ -67,6 +71,7 @@ void setup() { ...@@ -67,6 +71,7 @@ void setup() {
} }
int main() { int main() {
setup();
int res; int res;
uint16_t len = uartp_recv(cmdbuf, CMDBUF_LEN - 1); uint16_t len = uartp_recv(cmdbuf, CMDBUF_LEN - 1);
uint8_t action = cmdbuf[0]; uint8_t action = cmdbuf[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment