element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Freedom development platform
  • Products
  • Dev Tools
  • Freedom development platform
  • More
  • Cancel
Freedom development platform
Blog How to set and check the 48-bit BLE MAC Address into KW4xZ/3xZ
  • Blog
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Freedom development platform requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bheemarao
  • Date Created: 22 Aug 2016 5:45 AM Date Created
  • Views 368 views
  • Likes 0 likes
  • Comments 0 comments
  • kw4xz/3xz
  • 48-bit ble mac address
Related
Recommended

How to set and check the 48-bit BLE MAC Address into KW4xZ/3xZ

bheemarao
bheemarao
22 Aug 2016
The content has been cited from https://community.nxp.com/thread/429919
 
 
Below is the summary on how to write and read MAC address for KW40/41 MCUs cited from NXP community https://community.nxp.com/thread/429919
 
On the BLE Host Stack, the device MAC addresses are defined at compile time. For each device, the MAC address can be modified in the app_preinclude.h file.
 
image
 
 
If you want to read a MAC address from the BLE Client you must call the function Gap_ReadPublicDeviceAddress (in our demos it is called in the function BleApp_Config in app.c). After this, the gPublicAddressRead_c event will occur every time a new MAC address is discovered. You must obtain these MAC addresses in the BleApp_GenericCallback (in app.c) by reading the pGenericEvent pointer as shown in the image below.
image
 
Every time a new MAC address is found nearby, this callback function will be called.
 
To program different MAC address for different KW40/41
 
The way you program different MAC addresses in production is by using a programmer with serialization capabilities (i.e. P&E Cyclone Max). In our stack, the MAC Address is stored in a global variable under the name gBDAddress_c. First you need to open the .map file that is generated in you code, look for this variable and get where it is located in flash.
image
 
Once you have the variable address, you can now use the same binary to program all the MCUs and use the serialization tool to overwrite only the memory location that contains the MAC address. Instructions for doing this will depend on the flashing tool you will use in production.
we need to overwrite the memory location again after we update another Apps on our unit.
 
For example, if we have heart_rate_sensor_app on KW41Z first then we program different MAC addresses on each unit. After that we update hci_app on it.
 
The memory location of the MAC address holding arraywill change with every application or even in the same application if the application code changes. To overcome this you need to make sure that this variable will have always the same location in memory. This has a different procedure depending on the IDE you are using. In IAR for example, adding a pragma before the variable in question does the trick.
 
#pragma location=address
 
char variable[size];
 
 
The content has been cited from https://community.nxp.com/thread/429919
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube