Commit 507f1d08 by Sebastian Renner

Can compile/run gapuino examples now

parent 7e8ccbfb
### Dirty fix for libmpfr version
`sudo ln -s /usr/lib/libmpfr.so.6 /usr/lib/libmpfr.so.4`
## Steps to getting the GAP SDK run on Linux
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
```
touch 90-ftdi_gapuino.rules
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
sudo mv 90-ftdi_gapuino.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
```
Comment this line in gap_sdk/tools/gap8-openocd
`GCC_WARNINGS="${GCC_WARNINGS} -Werror"`
### Fix libmpfr version error
`sudo ln -s /usr/lib/libmpfr.so.6 /usr/lib/libmpfr.so.4`
......@@ -12,6 +12,5 @@
platform = riscv_gap
board = gapuino
framework = mbed
board_upload.boot_mode = jtag_hyper
board_upload.boot_mode = jtag
board_upload.commands = reqloop ioloop start wait
......@@ -2,12 +2,14 @@
#include "uartp.h"
#include "crypto_aead.h"
#include "mbed.h"
#include "gap_common.h"
#include "cmsis.h"
#define MAX_BYTES 100
#define CMDBUF_LEN 72
static uint8_t cmdbuf[CMDBUF_LEN];
#define CRYPTO_BUSY GPIO_A23
#define CRYPTO_BUSY GPIO_A21
Serial device(USBTX, USBRX);
......@@ -24,6 +26,7 @@ int res = 0;
void setup();
//void loop();
DigitalOut crypto_pin(CRYPTO_BUSY);
#ifdef __cplusplus
......@@ -54,6 +57,7 @@ void my_assert(bool b) {
}
void setup() {
PORT_SetPinMux(PORTA, 35, uPORT_MuxGPIO);
device.baud(115200);
crypto_pin = 1;
wait(100);
......@@ -67,6 +71,7 @@ void setup() {
}
int main() {
setup();
int res;
uint16_t len = uartp_recv(cmdbuf, CMDBUF_LEN - 1);
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