TheThingsIndustries / generic-node-se

Generic Node Sensor Edition
https://www.genericnode.com
Other
110 stars 31 forks source link

Docker container for image compilation #64

Closed elsalahy closed 3 years ago

elsalahy commented 3 years ago

Summary:

We can have a docker container integration to reduce the number of tools that the user need to install when they use our repository. The user should be able to build our repo on any operating system without needing to install any compilers, make or CMAKE tools. They should only need to install docker and be able to build a binary for the device easily.

Why do we need this?

To have smooth development experience.

What is already there? What do you see now?

Normal compilation process that requires the user to install CMAkE and GCC compiler to be able to build an image.

What is missing? What do you want to see?

A docker container that has all the tools that the developer needs for building an application without needing to install all the tools on their OS

How do you propose to implement this?

Create a docker container with all the tools. Create a guide on how to build the repo using it.

Environment:

Docker + baremetal repo

Acceptance Criteria:

The build speed and process of compilation is maintained.

What can you do yourself and what do you need help with?

ALL

KrishnaIyer commented 3 years ago

Like this one; https://hub.docker.com/r/krishnaiyer/docker-mbed-gcc-arm 😈

elsalahy commented 3 years ago

Like this one; https://hub.docker.com/r/krishnaiyer/docker-mbed-gcc-arm 😈

Like this one indeed but not for Mbed. For ARM GCC and CMAKE and the unit testing tool

elsalahy commented 3 years ago

One thing to add is a customizable linker script that allows for application layer configurations of the application size and location

#if !defined(GNSE_HEAP_SIZE)
  #define GNSE_HEAP_SIZE 0x200 /* default _Min_Heap_Size */
#endif

#if !defined(GNSE_STACK_SIZE)
  #define GNSE_STACK_SIZE 0x800 /* defualt _Min_Stack_Size */
#endif

#if !defined(GNSE_APP_START)
  #define GNSE_APP_START 0x0800000 /* defualt ROM ORIGIN */
#endif

#if !defined(GNSE_APP_SIZE)
  #define GNSE_APP_SIZE 0x00040000 /* defualt ROM LENGTH = 256K */
#endif

/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = ORIGIN(RAM1) + LENGTH(RAM1); /* end of "SRAM1" Ram type memory */

_Min_Heap_Size  = GNSE_HEAP_SIZE; /* required amount of heap  */
_Min_Stack_Size = GNSE_STACK_SIZE; /* required amount of stack */

/* Memories definition */
MEMORY
{
  ROM    (rx)    : ORIGIN = GNSE_APP_START, LENGTH = GNSE_APP_SIZE   /* Flash memory dedicated to CM4 */
  RAM1   (xrw)   : ORIGIN = 0x20000000, LENGTH = 32K    /* Non-backup SRAM1 dedicated to CM4 */
  RAM2   (xrw)   : ORIGIN = 0x20008000, LENGTH = 32K    /* Backup SRAM2 dedicated to CM4 */
}

And then run this command

arm-none-eabi-gcc -E -x c -Iinclude stm32wl55xx_flash.ld | grep -v '^#' > stm32wl55xx_flash_out.ld

In order to do this we need the docker container.

azerimaker commented 3 years ago

@elsalahy , will this docker also contain the basic example apps?

elsalahy commented 3 years ago

yes, it will allow everyone to compile and user our applications/repository.

docker containers create a development environment around our repository, so developers don't have to install the tools to use our repository, and they can use the image with any platform