diff --git a/bootloader/main.c b/bootloader/main.c
index 0216e40e421bdd9cb763171920bb6deb6b31922c..102d45023078610e2b9b463163d93bfed7d807cb 100644
--- a/bootloader/main.c
+++ b/bootloader/main.c
@@ -13,6 +13,7 @@
 #include "led.h"
 #include "ff.h"
 #include "crc16-ccitt.h"
+#include "pb.h"
 
 
 #define GPIO_PORT_IN                PORT_1
@@ -161,6 +162,8 @@ static inline void boot(const void * vtable){
     SCB->VTOR = (uintptr_t) vtable;
 
 	// Reset stack pointer & branch to the new reset vector.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated"
 	__asm(  "mov r0, %0\n"
 			"ldr sp, [r0]\n"
 			"ldr r0, [r0, #4]\n"
@@ -168,6 +171,7 @@ static inline void boot(const void * vtable){
 			:
 			: "r"(vtable)
 			: "%sp", "r0");
+#pragma GCC diagnostic pop
 };
 
 
diff --git a/epicardium/api/genapi.py b/epicardium/api/genapi.py
index c83358b50311eabc6a2bfa06b794c9eaf7954cb4..4c1f1f321462d70fa3e67763fbf12e8c70211c93 100644
--- a/epicardium/api/genapi.py
+++ b/epicardium/api/genapi.py
@@ -201,7 +201,7 @@ void __api_dispatch_call(uint32_t id, void*buffer)
         tmp = """\
         default:
                 /* TODO: Better error handling */
-                printf("Error: API function %x is unknown!!\\n", id);
+                printf("Error: API function %lx is unknown!!\\n", id);
                 break;
         }}
 }}
diff --git a/hw-tests/bmetest/main.c b/hw-tests/bmetest/main.c
index 93595ffde78b24ad374f948cc4c72f57ab9e7618..0c44012965e3c0528f1d6ecf998a5015bb74a559 100644
--- a/hw-tests/bmetest/main.c
+++ b/hw-tests/bmetest/main.c
@@ -79,25 +79,25 @@ int main(void)
         struct bme680_field_data data;
         rslt = bme680_get_sensor_data(&data, &gas_sensor);
 
-        printf("T: %.2f degC, P: %.2f hPa, H %.2f %%rH ", data.temperature / 100.0l,
+        printf("T: %.2Lf degC, P: %.2Lf hPa, H %.2Lf %%rH ", data.temperature / 100.0l,
             data.pressure / 100.0l, data.humidity / 1000.0l );
 
         char buf[128];
-        sprintf(buf, "T: %.2f degC", data.temperature / 100.0l);
+        sprintf(buf, "T: %.2Lf degC", data.temperature / 100.0l);
         Paint_DrawString_EN(0, 0, buf, &Font16, 0x0000, 0xffff);
 
-        sprintf(buf, "P: %.2f hPa", data.pressure / 100.0l);
+        sprintf(buf, "P: %.2Lf hPa", data.pressure / 100.0l);
         Paint_DrawString_EN(0, 16, buf, &Font16, 0x0000, 0xffff);
 
-        sprintf(buf, "H: %.2f %%rH", data.humidity / 1000.0l);
+        sprintf(buf, "H: %.2Lf %%rH", data.humidity / 1000.0l);
         Paint_DrawString_EN(0, 32, buf, &Font16, 0x0000, 0xffff);
 
         //printf("%.2f,%.2f,%.2f\n", data.temperature / 100.0f,
         //    data.pressure / 100.0f, data.humidity / 1000.0f );
         /* Avoid using measurements from an unstable heating setup */
         if(data.status & BME680_GASM_VALID_MSK) {
-            printf(", G: %d ohms", data.gas_resistance);
-            sprintf(buf, "G: %d ohms", data.gas_resistance);
+            printf(", G: %ld ohms", data.gas_resistance);
+            sprintf(buf, "G: %ld ohms", data.gas_resistance);
             Paint_DrawString_EN(0, 48, buf, &Font16, 0x0000, 0xffff);
         }
 
diff --git a/hw-tests/dual-core/core1.c b/hw-tests/dual-core/core1.c
index 989c611a026d2241fcda709854fe1abe7e23ca7e..05bc29bf77db3979524db011241b6b4b582b2e36 100644
--- a/hw-tests/dual-core/core1.c
+++ b/hw-tests/dual-core/core1.c
@@ -2,7 +2,7 @@
 #include "gpio.h"
 #include "mxc_delay.h"
 
-static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
+static const __attribute__((unused)) gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
 
 int main(void)
 {
diff --git a/hw-tests/ecgtest/main.c b/hw-tests/ecgtest/main.c
index 282a0685d6b3f67c2589c8e31d3f5e1e6c2dfe53..70337ebd4943be692e9bdc9e9addae26e23de26c 100644
--- a/hw-tests/ecgtest/main.c
+++ b/hw-tests/ecgtest/main.c
@@ -14,6 +14,7 @@
 #include "i2c.h"
 #include "rtc.h"
 #include "spi.h"
+#include "pb.h"
 #include "MAX30003.h"
 #include "GUI_DEV/GUI_Paint.h"
 #include "pmic.h"
@@ -53,7 +54,7 @@ static uint32_t ecg_read_reg(uint8_t reg)
 
 static void ecg_write_reg(uint8_t reg, uint32_t data)
 {
-    printf("write %02x %06x\n", reg, data);
+    printf("write %02x %06lx\n", reg, data);
     spi_req_t req;
     uint8_t tx_data[] = {(reg << 1) | 0 , data >> 16, (data >> 8 ) & 0xFF, data & 0xFF};
     uint8_t rx_data[] = {0, 0, 0, 0};
@@ -407,7 +408,7 @@ int main(void)
 
     for(int i=0; i<0x20; i++) {
         uint32_t val = ecg_read_reg(i);
-        printf("%02x: 0x%06x\n", i, val);
+        printf("%02x: 0x%06lx\n", i, val);
     }
 
     ecg_write_reg(SYNCH, 0);
diff --git a/hw-tests/hello-freertos/CLI-commands.c b/hw-tests/hello-freertos/CLI-commands.c
index 63a84a942ea0c696b79ada28a584cf9bbd515328..3abb3ca04edd16eca41fd7787facb4dd259ef3a0 100644
--- a/hw-tests/hello-freertos/CLI-commands.c
+++ b/hw-tests/hello-freertos/CLI-commands.c
@@ -200,11 +200,11 @@ static BaseType_t prvUptimeCommand(char *pcWriteBuffer, size_t xWriteBufferLen,
 
 #if configUSE_TICKLESS_IDLE
   pcWriteBuffer += snprintf(pcWriteBuffer, xWriteBufferLen,
-			    "Uptime is 0x%08x (%u ms)\r\nMXC_RTCTMR->timer is %u\r\n",
+			    "Uptime is 0x%08lx (%lu ms)\r\nMXC_RTCTMR->timer is %lu\r\n",
 			    ticks, ticks / portTICK_PERIOD_MS, MXC_RTC->sec);
 #else
   pcWriteBuffer += snprintf(pcWriteBuffer, xWriteBufferLen,
-			    "Uptime is 0x%08x (%u ms)\r\n",
+			    "Uptime is 0x%08lx (%lu ms)\r\n",
 			    ticks, ticks / portTICK_PERIOD_MS);
 #endif
 
@@ -257,7 +257,7 @@ static BaseType_t lParameterNumber = 0;
 		memset( pcWriteBuffer, 0x00, xWriteBufferLen );
 		sprintf( pcWriteBuffer, "%d: ", (int)lParameterNumber );
 		strncat( pcWriteBuffer, pcParameter, lParameterStringLength );
-		strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
+		strcat( pcWriteBuffer, "\r\n");
 
 		/* If this is the last of the three parameters then there are no more
 		strings to return after this one. */
@@ -323,7 +323,7 @@ static BaseType_t lParameterNumber = 0;
 			memset( pcWriteBuffer, 0x00, xWriteBufferLen );
 			sprintf( pcWriteBuffer, "%d: ", (int)lParameterNumber );
 			strncat( pcWriteBuffer, pcParameter, lParameterStringLength );
-			strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
+			strcat( pcWriteBuffer, "\r\n");
 
 			/* There might be more parameters to return after this one. */
 			xReturn = pdTRUE;
diff --git a/hw-tests/hello-freertos/main.c b/hw-tests/hello-freertos/main.c
index 3600e2fe738e5d117003a061a7cf39e774ae883a..c0f74a2968d9618dfb0e01303582e7081461e4a1 100644
--- a/hw-tests/hello-freertos/main.c
+++ b/hw-tests/hello-freertos/main.c
@@ -186,7 +186,7 @@ void vTickTockTask(void *pvParameters)
   
   while (1) {
     ticks = xTaskGetTickCount();
-    printf("Uptime is 0x%08x (%u seconds), tickless-idle is %s\n",
+    printf("Uptime is 0x%08lx (%lu seconds), tickless-idle is %s\n",
 	   ticks, ticks / configTICK_RATE_HZ,
 	   disable_tickless ? "disabled" : "ENABLED");
     vTaskDelayUntil(&xLastWakeTime, (configTICK_RATE_HZ * 60));
diff --git a/hw-tests/hello-world/main.c b/hw-tests/hello-world/main.c
index dc7d6c87a1dcd45b01908c9e5da837aae3dea4fa..6581b97c4809d5b66a33c9c1ee9fbfbe3375aa2c 100644
--- a/hw-tests/hello-world/main.c
+++ b/hw-tests/hello-world/main.c
@@ -19,7 +19,7 @@
 /***** Definitions *****/
 
 /***** Globals *****/
-static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
+static __attribute__((unused)) const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
 
 int main(void)
 {
@@ -35,7 +35,7 @@ int main(void)
         leds_set_dim(i, 1);
     }
 
-    int h = 0;
+    int __attribute__((unused)) h = 0;
     while (1) {
 #if 0
 
diff --git a/hw-tests/imutest/main.c b/hw-tests/imutest/main.c
index 8aafc254d13ed3047d91b2dc560232101a87f51d..8b5f1ec4f23693f2c5fabfa922157bd8f3ecdb4f 100644
--- a/hw-tests/imutest/main.c
+++ b/hw-tests/imutest/main.c
@@ -101,7 +101,7 @@ static void sensors_callback_orientation(bhy_data_generic_t * sensor_data, bhy_v
 }
 
 
-static void sensors_callback_vector(bhy_data_generic_t * sensor_data, bhy_virtual_sensor_t sensor_id)
+static __attribute__((unused)) void sensors_callback_vector(bhy_data_generic_t * sensor_data, bhy_virtual_sensor_t sensor_id)
 {
     printf("x=%05d, y=%05d, z=%05d status=%d\n",
     sensor_data->data_vector.x,
@@ -111,7 +111,7 @@ static void sensors_callback_vector(bhy_data_generic_t * sensor_data, bhy_virtua
     );
 }
 
-static void sensors_callback_vector_uncalib(bhy_data_generic_t * sensor_data, bhy_virtual_sensor_t sensor_id)
+static __attribute__((unused)) void sensors_callback_vector_uncalib(bhy_data_generic_t * sensor_data, bhy_virtual_sensor_t sensor_id)
 {
     printf("x=%05d, y=%05d, z=%05d status=%d\n",
     sensor_data->data_uncalib_vector.x,
@@ -128,7 +128,7 @@ static void sensors_callback_vector_uncalib(bhy_data_generic_t * sensor_data, bh
  * @param[in]   sensor_data
  * @param[in]   sensor_id
  */
-static void sensors_callback_rotation_vector(bhy_data_generic_t * sensor_data, bhy_virtual_sensor_t sensor_id)
+static __attribute__((unused)) void sensors_callback_rotation_vector(bhy_data_generic_t * sensor_data, bhy_virtual_sensor_t sensor_id)
 {
 #if 0
     float temp;
diff --git a/lib/card10/card10.c b/lib/card10/card10.c
index cf377e390903d1526be294145a249c776f64e040..a2037ff9aef56068add905fdcfd9867698d2e343 100644
--- a/lib/card10/card10.c
+++ b/lib/card10/card10.c
@@ -170,7 +170,7 @@ void card10_diag(void)
     }
 #else
     uint32_t val = ecg_read_reg(0xf);
-    printf("ECG: %02x: 0x%06x (should be 0x5139a0)\n", 0xf, val);
+    printf("ECG: %02x: 0x%06lx (should be 0x5139a0)\n", 0xf, val);
 #endif
 
 }
diff --git a/lib/gfx/display.c b/lib/gfx/display.c
index e68e23910e0705d8270a8c5f83788206567ed061..1caa81c300b2e0d00e6f705833eab42d1656ee4f 100644
--- a/lib/gfx/display.c
+++ b/lib/gfx/display.c
@@ -7,7 +7,6 @@
 #include <stdint.h>
 #include <stdio.h>
 /***** Globals *****/
-static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
 //const gpio_cfg_t DEV_RST_PIN = {PORT_0, PIN_28, GPIO_FUNC_OUT, GPIO_PAD_NONE};
 const gpio_cfg_t DEV_DC_PIN = {PORT_1, PIN_6, GPIO_FUNC_OUT, GPIO_PAD_NONE};
 
diff --git a/lib/micropython/gen-version.sh b/lib/micropython/gen-version.sh
index fd56bd99b56117b79a1c9ab15818a7bd7d049717..1afe401e5dd8cb479a3dc3e09da8315bad3dac0f 100755
--- a/lib/micropython/gen-version.sh
+++ b/lib/micropython/gen-version.sh
@@ -10,4 +10,4 @@ mkdir -p "$OUTDIR/genhdr"
 ln -sfr "$OUT" "$OUTDIR/genhdr/$(basename "$OUT")"
 
 cd "$2/micropython"
-"$1" "$2/micropython/py/makeversionhdr.py" "$OUT"
+"$1" "$2/micropython/py/makeversionhdr.py" "$OUT" >/dev/null
diff --git a/lib/sdk/Libraries/MAX32665PeriphDriver/meson.build b/lib/sdk/Libraries/MAX32665PeriphDriver/meson.build
index e6ed059fb24d61fe4ea1b7d035226a8622860c6d..6dd4f7284803af04105ff22dc0d1ddea75dfbc80 100644
--- a/lib/sdk/Libraries/MAX32665PeriphDriver/meson.build
+++ b/lib/sdk/Libraries/MAX32665PeriphDriver/meson.build
@@ -52,6 +52,7 @@ lib = static_library(
   'PeriphDriver',
   sources,
   include_directories: includes,
+  c_args: '-w',
 )
 
 periphdriver = declare_dependency(
diff --git a/lib/sdk/Libraries/MAXUSB/meson.build b/lib/sdk/Libraries/MAXUSB/meson.build
index 6df655d6978c03a658b2f6a4c6d86fc937c35e26..01f090928bb88b630855313e39515d06ef701ae9 100644
--- a/lib/sdk/Libraries/MAXUSB/meson.build
+++ b/lib/sdk/Libraries/MAXUSB/meson.build
@@ -24,6 +24,7 @@ lib = static_library(
   sources,
   include_directories: includes,
   dependencies: periphdriver,
+  c_args: '-w',
 )
 
 maxusb = declare_dependency(
diff --git a/lib/vendor/Bosch/BHy1/meson.build b/lib/vendor/Bosch/BHy1/meson.build
index a63540cc5fbab4036c86f0ffa75aebe405adb05b..3c30388ccaa573f504dec265b8339a69c9b9f85f 100644
--- a/lib/vendor/Bosch/BHy1/meson.build
+++ b/lib/vendor/Bosch/BHy1/meson.build
@@ -16,6 +16,7 @@ lib = static_library(
   sources,
   include_directories: includes,
   dependencies: periphdriver,
+  c_args: '-w',
 )
 
 bhy1 = declare_dependency(
diff --git a/lib/vendor/Maxim/MAX86150/meson.build b/lib/vendor/Maxim/MAX86150/meson.build
index 8254e30096068491c0d86d9042df64271f2873da..0943fd8a9a6a6273beb35cddbd6074bd584b74cc 100644
--- a/lib/vendor/Maxim/MAX86150/meson.build
+++ b/lib/vendor/Maxim/MAX86150/meson.build
@@ -6,6 +6,7 @@ lib = static_library(
   'max86150',
   'max86150.c',
   dependencies: periphdriver,
+  c_args: '-w',
 )
 
 max86150 = declare_dependency(