v01d commented on a change in pull request #2735:
URL: https://github.com/apache/incubator-nuttx/pull/2735#discussion_r565409512



##########
File path: arch/arm/src/nrf52/Make.defs
##########
@@ -163,3 +163,89 @@ endif
 ifeq ($(CONFIG_PM),y)
 CHIP_CSRCS += nrf52_pminitialize.c
 endif
+
+ifeq ($(CONFIG_NRF52_SOFTDEVICE_CONTROLLER),y)
+
+NRFXLIB_UNPACK  := sdk-nrfxlib
+NRFXLIB_VER     := 1.4.2
+NRFXLIB_REF     := v$(NRFXLIB_VER)
+NRFXLIB_TGZ     := $(NRFXLIB_REF).tar.gz
+NRFXLIB_URL     := https://github.com/nrfconnect/sdk-nrfxlib/archive
+
+NRFX_UNPACK     := nrfx
+NRFX_VER        := 2.4.0
+NRFX_REF        := v$(NRFX_VER)
+NRFX_TGZ        := $(NRFX_REF).tar.gz
+NRFX_URL        := https://github.com/NordicSemiconductor/nrfx/archive
+
+CMSIS_UNPACK    := CMSIS_5
+CMSIS_VER       := 5.7.0
+CMSIS_REF       := $(CMSIS_VER)
+CMSIS_TGZ       := $(CMSIS_REF).tar.gz
+CMSIS_URL       := https://github.com/ARM-software/CMSIS_5/archive
+
+$(NRFXLIB_TGZ):
+       $(Q) echo "Downloading: NRFXLIB"
+       $(Q) curl -L $(NRFXLIB_URL)/$(NRFXLIB_TGZ) -o chip/$(NRFXLIB_TGZ)
+
+$(NRFX_TGZ):
+       $(Q) echo "Downloading: NRFX"
+       $(Q) curl -L $(NRFX_URL)/$(NRFX_TGZ) -o chip/$(NRFX_TGZ)
+
+$(CMSIS_TGZ):
+       $(Q) echo "Downloading: CMSIS"
+       $(Q) curl -L $(CMSIS_URL)/$(CMSIS_TGZ) -o chip/$(CMSIS_TGZ)
+
+chip/$(NRFXLIB_UNPACK): $(NRFXLIB_TGZ)
+       $(Q) echo "Unpacking: NRXFLIB"
+       $(Q) cd chip && tar zxf $(NRFXLIB_TGZ)
+       $(Q) mv chip/$(NRFXLIB_UNPACK)-$(NRFXLIB_VER)* chip/$(NRFXLIB_UNPACK)
+       $(Q) touch chip/$(NRFXLIB_UNPACK)
+
+chip/$(NRFX_UNPACK): $(NRFX_TGZ)
+       $(Q) echo "Unpacking: NRXF"
+       $(Q) cd chip && tar zxf $(NRFX_TGZ)
+       $(Q) mv chip/$(NRFX_UNPACK)-$(NRFX_VER)* chip/$(NRFX_UNPACK)
+       $(Q) touch chip/$(NRFX_UNPACK)
+
+chip/$(CMSIS_UNPACK): $(CMSIS_TGZ)

Review comment:
       I justed looked at what is used from CMSIS and it seems it is only these 
definitions:
   
   ```
   #ifdef __cplusplus
     #define   __I     volatile             /*!< Defines 'read only' 
permissions */
   #else
     #define   __I     volatile const       /*!< Defines 'read only' 
permissions */
   #endif
   #define     __O     volatile             /*!< Defines 'write only' 
permissions */
   #define     __IO    volatile             /*!< Defines 'read / write' 
permissions */
   
   /* following defines should be used for structure members */
   #define     __IM     volatile const      /*! Defines 'read only' structure 
member permissions */
   #define     __OM     volatile            /*! Defines 'write only' structure 
member permissions */
   #define     __IOM    volatile            /*! Defines 'read / write' 
structure member permissions */
   ```
   
   As per nrfx, it seems that I only need the definition of type `IRQn_Type` 
which is an enum. I could make a typedef but I'm not sure what is the 
appropriate size (I've read that it could be 8 bits if there are less than 256 
values but it could also be 32 bits).
   
   We could avoid downloading nrfx and CMSIS this way, but I would need to 
probably patch nrfxlib to not include core_cm4.h and nrf.h (and provide these 
defininitions in separate header included before sdc/mpsl headers).
   
   With these changes would it look better for you? We would only download 
nrfxlib, which is still a bit large but we need various files from there anyway.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to