JN518x: building with MMAC.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JN518x: building with MMAC.

Jump to solution
2,101 Views
usaygo
Contributor III

Hello,

I feel a bit hard to compile for JN5189 with MMAC library. Is there any guide for define building project with MMAC on the latest SDK (2.6.3)?

I just want to perform the very initial testing for packet transmit or receive, and I don't need full 802.15.4 functionality.

I tried:

  • Build "Packet sniffer" from JN-AN-1255 with SDK2.6.0 firstly. This seem working! Then I tried replacing SDK2.6.0 by SDK2.6.3 files. This does not work (hung up at boot stage???).
  • Define a new project via the wizard, then add MMAC code and linking library.  The "__mac_buffer_start" needs to be defined to compile. By copying auto generated .ld file and add "__mac_buffer_start" entry from the 0x4000000 for 0x400 bytes (So far I don't understand how to add such entry by "linkscripts"). This does not work as well. It boots, but hung up at the call of vMMAC_EnableInterrupts().
  • Define a new project and assign "AppBuildNone.ld". It does not boot.
  • Others
    • MCUXpresso 11.3.1
    • Target: JN5189THN
    • The post build process of python script (modify bin image) runs without an error.

 

Questions:

  1. Is there any good example or guide to build MMAC apps?
  2. Should we use "AppBuildNone.ld" for JN518x? Or start with wizards?
    • I guess AppBuildNone.ld is more close to existing JENNIC codes. (My requirement is not hard to be compatible with JN516x, but to go with standard arm codes as possible.)
  3. Or simply should we go with SDK2.6.0?
0 Kudos
Reply
1 Solution
2,081 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @usaygo,

-What is the Python version that you have installed?

Build "Packet sniffer" from JN-AN-1255 with SDK2.6.0 firstly. This seems working! Then I tried replacing SDK2.6.0 by SDK2.6.3 files. This does not work (hung up at boot stage???).

-Could you please provide the errors that you are seeing?

  • Is there any good example or guide to building MMAC apps?

Unfortunately, we do not provide a guide or example to build an MMAC example.

  • Should we use "AppBuildNone.ld" for JN518x? Or start with wizards?
    • I guess AppBuildNone.ld is more close to existing JENNIC codes. (My requirement is not hard to be compatible with JN516x, but to go with standard arm codes as possible.)

Please use the AppBuildNone.Id instead of the wizards.

 

Regards,

Mario

View solution in original post

0 Kudos
Reply
8 Replies
1,945 Views
usaygo
Contributor III

I might have identified the root cause of this issue. 

When I made a question, I used startup_JN5189.cpp (not .c) which does not have any interrupt handlers definition regarding 15.4 MAC. Now I replaced it by startup_JN5189.c at SDK2_6_4, it works fine. And also it should not to be with AddBuildNond.ld but it could be with Managed Linker Script as well. 

If Managed Linker Script is used, the file (linkscripts/user_memory.ldt) should be added and (maybe) RAM should configured to start from 0x4000400. (But I can't see any changes in memory starting from 0x4000000.)

  __mac_buffer_base                       = 0x04000000;

 

Anyway, the project wizard will introduce startup_JN5189.cpp, however this file should be replaced by startup_JN5189.c in {SDKROOT}/devices/JN5189/gcc/.

Thanks for many comments and help!

2,044 Views
usaygo
Contributor III

Hello,

I had an update and progress

The reason of my confusion was "startup_JN5189.c".

The key to use MMAC seems two things below:

  • The "startup_JN5189.c" should be version 141204 from "devices/JN5189/gcc".
    • "startup_JN5189.c" version 151018, "startup_JN5189.cpp" version 151018 are not good. The JN5189 might hung up with AppBuildNone.ld)
  • Build with "AppBuildNone.ld". (depending startup_JN5189 ver 141204???)
    • otherwise (managed linker, etc), MMAC does not work properly. It may cause hung up when some MMAC function is called or receiving a wireless packet.
    • I tried using a library from SDK2_6_0 at SDK2_6_3 project, but this is not the solution. It does not work as well.

 

Thanks!
//Seigo

0 Kudos
Reply
2,073 Views
usaygo
Contributor III

Just small update,

  • Linking with library (libMiniMac.a, libRadio.a from 2_6_0) to a project defined using SDK2_6_3 seems working. (vMMAC_EnableInterrupts() does not cause hung up.)
    • Using managed link (so far, "__mac_buffer_start" is not located correctly. I need to learn about linkerscripts or AddBuildNone.ld)
    • Again I tried libMiniMac.a to 2_6_3, then it causes hung up at vMMAC_EnableInterrupts().
      • I guess something is necessary to use libMiniMac.a (2_6_3)???

 

Hi Mario,

Thanks for the comment. 

  • Python version: Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:25:05) [MSC v.1500 64 bit (AMD64)] on win32
    • Installing Crypto was a bit troublesome, but installed.
  • Errors: I don't see any building errors.

 

I guess AppBuildNone.ld is more close to existing JENNIC codes.

Thanks. Hmm, my existing code is not depended JENNIC style tightly. So I'm thinking of port them to standard ARM style...  However SDK code is very confusing because some API sets are existing (some are Jennic, some are Kinetis, some are generic ARM). Also endian is different now... I feel a big leap from JN516x

Please use the AppBuildNone.Id instead of the wizards.

I will try it later. First thing to do is check the workings of MMAC.

 

Regards,
Seigo

0 Kudos
Reply
2,058 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @usaygo,

Could you please update the Python version that you have? the SDK was updated to work with the 3.8 version.

For more information please look at the next AN.

Application Note: JN-AN-1260  5.5 Python3 Installation

The image signing tool is implemented in Python. This requires Python 3.8.0 or a newer version to be installed, which can be downloaded from the following web page:
https://www.python.org/downloads/release/python-380/

Please let me know your findings

Regards,

Mario

0 Kudos
Reply
2,043 Views
usaygo
Contributor III

Thanks Mario.

I checked Python version. It seems okay.

  • Python2.7 should be present for SDK2_6_0. (the script was written in ver2.x manner.)
  • I used Python3.7.5 for SDK2_6_3 (from "py -3") and also tried 3.8.X and 3.9.X. They don't have  any difference.

//Seigo

0 Kudos
Reply
2,082 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @usaygo,

-What is the Python version that you have installed?

Build "Packet sniffer" from JN-AN-1255 with SDK2.6.0 firstly. This seems working! Then I tried replacing SDK2.6.0 by SDK2.6.3 files. This does not work (hung up at boot stage???).

-Could you please provide the errors that you are seeing?

  • Is there any good example or guide to building MMAC apps?

Unfortunately, we do not provide a guide or example to build an MMAC example.

  • Should we use "AppBuildNone.ld" for JN518x? Or start with wizards?
    • I guess AppBuildNone.ld is more close to existing JENNIC codes. (My requirement is not hard to be compatible with JN516x, but to go with standard arm codes as possible.)

Please use the AppBuildNone.Id instead of the wizards.

 

Regards,

Mario

0 Kudos
Reply
2,035 Views
usaygo
Contributor III

> Unfortunately, we do not provide a guide or example to build an MMAC example.

The code from contiki project is a good example. Thanks!

https://contiki-ng.readthedocs.io/en/master/_api/micromac-radio_8c_source.html

//Seigo

0 Kudos
Reply
2,042 Views
usaygo
Contributor III

Hi Mario,

That's it. The "AppBuildNone.ld" is the key for MMAC library. As I post just before, I also need to take care of the version of "startup_JN5189.c". The wizard takes improper version for "AppBuildNone.ld".

Thank you for many comments. Now my code receives 802.15.4 packets!

//Seigo