[Compilation] 4, under Linux to build nRF51822 development burning Environment (makefile version)

Source: Internet
Author: User

Sunday, 09. September 2018 07:51 pm-beautifulzzzz

1. Installation Steps
    • 1) Download the latest Gcc-arm toolchain from the GNU Arm Embedded Toolchain website, which is downloaded as follows:

        gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2


    • 2) Download the corresponding version of the SDK from Nordic website, I choose 12.3.0 Version:

      Code Name Version
      Nrf5-sdk-v12-zip NRF5 SDK Zip File-works with S132 v3 and S130 v2 12.3.0
      Nrf5-sdk-zip NRF5 SDK Zip file-works with S112 v6.1.0, S132 v6.1.0, S140 v6.1.0, and S212 v5.0.0
      Note that the nRF51 Series is included up until v12.3 of the nRF5 SDK
      15.1.0


    • 3) Unzip the toolchain and NRF5-SDK to the AAAA directory and edit the Sdk_root/components/toolchain/gcc/makefile.posix:

        GNU_INSTALL_ROOT := /home/btfz/Downloads/AAAA/gcc-arm-none-eabi-5_4-2016q3  GNU_VERSION := 5.4.1  GNU_PREFIX := arm-none-eabi


    • 4) from Nordic official website under the nrf5x-tools-linux, I download the version is (after decompression also placed in AAAA directory):

        nRF5x-Command-Line-Tools_9_7_3_Linux-x86_64.tar


    • 5) Download the latest J-link Toolkit J-link software and documentation pack from Segger official website, I am downloading the latest linux-64 bit-deb installation version:

2, compiling and burning write Blink project
  • 1) Check the Development Board for the chip used for NRF51822-QFAA, refer to nRF51822 Product Anomaly Notification v3.3, learned that Qfaa is a KB Flash, KB RAM:

  • 2) Reference Developer (#5) >software development Kit > NRF5 SDK > NRF5 SDK v12.3.0 > Getting Started > Using The SDK is described in the following boards:

    Depending on the device on the legacy board, you might need to change the memory Layo Ut. For example, all nRF51 examples assume that is using the the-the-KB variant of nRF51, so if your is using a variant with 1 6 KB RAM, You must decrease the size of IRAM1 by a KB (0x4000 in hex) . In Keil, click Project > Options for Target ' ... ' and modify the values for "Read/write Memory area". For GCC, change the linked *.ld file in the Makefile.

    So you need to modify nrf5_sdk_12.3.0_d7731ad/examples/peripheral/blinky/pca10028/blank/armgcc/blinky_gcc_nrf51.ld The RAM in the is configured as 0x4000:

      MEMORY {FLASH (RX): origin = 0x0, LENGTH = 0x40000 RAM (rwx): Origin = 0x20000000, LENGTH = 0x4000}  

    Note: If the RAM size does not meet the conditions, it will cause the program to write successfully, but no effect!!!

  • 3) Compile and run (take Blinky-blank as an example):

     ?  CD/EXAMPLES/PERIPHERAL/BLINKY/PCA10028/BLANK/ARMGCC?  ARMGCC make clean rm-rf _build?  ARMGCC make all mkdir _build compiling file:nrf_log_backend_serial.c ...      Compiling file:system_nrf51.c linking target: _build/nrf51422_xxac.out text data BSS Dec hex filename 3160 3384 d38 _build/nrf51422_xxac.out Preparing: _build/nrf51422_xxac.hex Preparing: _build /nrf51422_xxac.bin  
  • 4) Burn Write run:

    Scripts that run burn-write are available in makefile, but there are two things to do before doing this:

    • Adding Nrfjprog to global variables
    • Modify the Erase chip type in makefile to nRF51

    Note: run once in the current terminal, which export PATH=$PATH:/home/btfz/Downloads/AAAA/nRF5x-Command-Line-Tools_9_7_3/nrfjprog/ is valid for the current window until the serial port is closed.

      ?  armgcc  export PATH=$PATH:/home/btfz/Downloads/AAAA/nRF5x-Command-Line-Tools_9_7_3/nrfjprog/  ?  armgcc  make erase  nrfjprog --eraseall -f nrf51  Erasing user available code and UICR flash areas.  Applying system reset.  ?  armgcc  make flash  Flashing: _build/nrf51422_xxac.hex  nrfjprog --program _build/nrf51422_xxac.hex -f nrf51 --sectorerase  Parsing hex file.  Erasing page at address 0x0.  Erasing page at address 0x400.  Erasing page at address 0x800.  Erasing page at address 0xC00.  Applying system reset.  Checking that the area to write is not protected.  Programming device.  nrfjprog --reset -f nrf51  Applying system reset.  Run.

3, compiling and writing ble-hrs project
    • 1) similar to the 2 need to adjust the RAM, here also to change the Flash and RAM configuration. Refer to S130_sds_v2.0.pdf 15.1 Memory resource map and usage :

      The usage of Flash is as follows:

      Where RAM is occupied by:

      Therefore, the configuration of the ble_app_hrs_gcc_nrf51.ld Flash and RAM in the modification is:

        MEMORY  {      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x23000      RAM (rwx) :  ORIGIN = 0x20002000, LENGTH = 0x2000  }
    • 2) Modify the erase in the Makefile Chip series for nrf51
    • 3) Burn write:

        make erase  make flash_softdevice  make flash

4, play nRF51822 necessary knowledge
    • 1) Board and Chip correspondence relationship

      Since nRf51822 and nRF51422 are not very different, we have been experimenting with pca10028 engineering. In addition I read the latest SDK in the demo, found no pca10028, I guess it should be nRF51822 in the new version of the SDK will not continue to support.

    • 2) protocol stack and chip correspondence relationship

      We can see that the S130 above supports many chips and has a ble central and peripheral function.

    • 3) Some protocol stacks provided by Nordic

LINKS

[1]. GNU Arm Embedded Toolchain
[2].nrf5-sdk Download Page
[3].nrf5x-tools-linux Download Page
[4].nrf51 Development Kit Complete setup for Linux
[5]. NORDIC Developer community-the most complete area of information
[6].nrf51822_pan_v3.3.pdf
[7]. S130_sds_v2.0.pdf

NRF51822 Series Articles

[nRF51822] 1, a simple nRF51822-driven Tianma 4-line SPI-1.77-inch LCD color Display Demo
[nRF51822] 2, D-bug's poems
[nRF51822] 3, the New Year is also a summary--graphical NRF51 SDK button handling library and FIFO library
[nRF51822] 4, schematic nRF51 SDK schedule handling library and timer library
[nRF51822] 5, PA screen-detailed nRF51 SDK in the Gpiote (from the Gpio level change to the process of generating the interrupt event detailed)
[nRF51822] 6, based on the nRF51822 platform Flash Read and write research
[nRF51822] 7, basic experimental Code Analysis Daquan (top ten)
[nRF51822] 8, basic experimental code Analysis Daquan · Experimental 11-ppi
[nRF51822] 9, basic experimental code Analysis Daquan · Experimental 12-ADC
[nRF51822] 10, basic experimental code Analysis Daquan · Experimental 15-RTC
[nRF51822] 11, basic experimental Code Analysis Daquan · Lab 16-Internal Flash read/write
[nRF51822] 12, basic experimental code Analysis Daquan · Experimental 19-PWM
[nRF51822] 13, talking about nRF51822 and NRF24LE1/NRF24LU1/NRF24L01 Classic 2.4G module wireless communication configuration and flow
[nRF51822] 14, talk about Bluetooth low power (BLE) of several common scenarios and architecture (science and technology Dry)
[nRF51822] 15, wearable equipment on the design and details of the power detection device (biased professional hardware article)
[nRF51822] 16, nRF51822 random number generator, and random number generator of some knowledge (can help you fill the knowledge of the random number generator)
[Exception resolution] Keil Install the nRF51822 development environment, run Demo error: Error: "Gpiote_config_num_of_low_power_envents" is undefined
[Exception resolution] How to build a gcc toolchain for nRF51 on Linux (very detailed!!!)
[Bluetooth] 1, Bluetooth core technology Understanding (Bluetooth protocol, architecture, hardware and software notes)
[Bluetooth] 2, Bluetooth BLE protocol and architecture analysis && based on broadcast timeout standby said broadcast event
[Bluetooth] 3, analysis ble heart rate test Project
[Bluetooth] 4, heart rate Service module
[Bluetooth] 5, Battery Service module
[Bluetooth] 6, based on the nRF51822 Bluetooth heart rate meter Project Message Flow log analysis (verbose)

@beautifulzzzz智能硬件、物联网,热爱技术,关注产品博客:http://blog.beautifulzzzz.com园友交流群:414948975

[Compilation] 4, under Linux to build nRF51822 development burning Environment (makefile version)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.