JN-AN-1218 build problems

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

JN-AN-1218 build problems

3,468 Views
youpko
Contributor II

I success fully compiled the JN-AN-1218 with the following configuration

make LIGHT=DimmableLight JENNIC_CHIP_FAMILY=JN516x JENNIC_CHIP=JN5168 DR=DR1175 TRACE=1 GP_SUPPORT=0 GP_DEVICE=COMBO_BASIC OTA=0 TOUCHLINK=1

But I want to implement my own DriverBulb interface, so i started with the DriverBulb_JN516X.c as a reference. Tried compiling that with:

make LIGHT=DimmableLight JENNIC_CHIP_FAMILY=JN516x JENNIC_CHIP=JN5168 DR=JN516X TRACE=1 GP_SUPPORT=0 GP_DEVICE=COMBO_BASIC OTA=0 TOUCHLINK=1

But that wont compile The linker gives an error:

../../DimmableLight/Build/irq_JN516x.o:(.text+0x4c): undefined reference to `vISR_SystemController'

But as far as I can tell the DriverBulb_JN516X.c has no correlation with "vISR_SystemController"

So commened out the folowing lines in "irq_JN516x.s" and left everyting else as how it was.

.globl  PIC_SwVectTable
    #.extern vISR_SystemController
PIC_SwVectTable:
    #.word vISR_SystemController             # 15

Compiled it with the same command as above. and that completes without any errors.

So the next step was to program the "DimmableLight_JN5168_JN516X.bin" into the JN5168-001-M00 module.

But i get the following in the serial output.

***********************************************
* LIGHT NODE RESET                            *
***********************************************
APP: Entering APP_vInitResources()
APP: Initialising resources...
APP_vInitialiseNode
eStatusReportReload = 0

Zll recovered state 00

 eCLD_ScenesCreateScenes: eCLD_ScenesCountScenes() u8SceneCount = 1MAKE Reportable ep 1
Cluster 0006 Attribute 0000 Min 1 Max 61 IntV 0 Direct 0 Change 0
Cluster 0008 Attribute 0000 Min 1 Max 61 IntV 0 Direct 0 Change 10

Set a random pan

Factory new start up
PDM: Capacity 29
PDM: Occupancy 34
APP: Entering BDB_vStart()
BDB: Disc on Ch 11 from 0x02108800
APP: Entering APP_vMainLoop()
BDB: APP_vGenCallback [0 10]
BDB: Disc on Ch 15 from 0x02108800
BDB: ZCL Event 6
BDB: APP_vGenCallback [0 10]
BDB: vNsTryNwkJoin - index 0 of 0 Nwks
BDB: No suitable network! Continue Discovery
BDB: Disc on Ch 20 from 0x02108800
BDB: ZCL Event 6
BDB: APP_vGenCallback [0 10]
BDB: Disc on Ch 25 from 0x02108800
BDB: ZCL Event 6
BDB: APP_vGenCallback [0 10]
BDB: Disc on Ch 12 from 0x05ef7000
BDB: ZCL Event 6
BDB: APP_vGenCallback [0 10]
BDB: Disc on Ch 13 from 0x05ef7000
BDB: ZCL Event 6
BDB: APP_vGenCallback [0 10]
BDB: Disc on Ch 14 from 0x05ef7000
BDB: ZCL Event 6

!!! Bus error
u32PICMR = 0 : u32PICSR = 8008
u32PICMSR = 0 : u32IPMR = 0
u32IHPR = c : u32AINT = 8008 u32PINT 0
EPCR = ad444 : EEAR = 2001f00
Stack dump:
 4007f58 : 00000002
 4007f5c : 00083237
 4007f60 : 00000006
 4007f64 : 000ad444
 4007f68 : 02001f00
 4007f6c : 00000000
 4007f70 : 0000000c
 4007f74 : 00000000
 4007f78 : 00008008
 4007f7c : 00000000
 4007f80 : 00000000
 4007f84 : 00008008
 4007f88 : 0000005a
 4007f8c : 000832a2
 4007f90 : 00000006
 4007f94 : 0008488a
 4007f98 : 00000002
 4007f9c : 00084589
 4007fa0 : 00000000
 4007fa4 : 00000000
 4007fa8 : 00000000
 4007fac : 00000000
 4007fb0 : 00000000
 4007fb4 : 00000000
 4007fb8 : 00000000
 4007fbc : 00000000
 4007fc0 : 00000000
 4007fc4 : 00000000
 4007fc8 : 00000000
 4007fcc : 00000000
 4007fd0 : 00000000
 4007fd4 : 000854ce
 4007fd8 : 00000000
 4007fdc : 00000003
 4007fe0 : 00000002
 4007fe4 : 00083387
 4007fe8 : 00000002
 4007fec : 00000a5b
 4007ff0 : 00000000
 4007ff4 : 00000000
 4007ff8 : 00091d35
 4007ffc : 76543210

So that stack dump clearly indicates that commeting out those lines was not the correct way to fix this.

I also tried to just stub out "vISR_SystemController" in the source file. (just implement the function but with no code in the body)

but that still gives the !!! Bus error stack dump.

How should I proceed to adapt the example code to my application?

0 Kudos
34 Replies

594 Views
youpko
Contributor II

Hi Mario,

I am not quite sure what you mean.

I looked into app_zlo_light_node.c and found the APP_taskLight function.

But that piece of code is not excecuted because it should send the following debug info to the UART:

DBG_vPrintf(TRACE_APP, "ZPR: App event %d, NodeState=%d\n", sAppEvent.eType, sZllState.eNodeState);

But that never shows up in the serial output.

This is what I get on the output.

***********************************************
* LIGHT NODE RESET                            *
***********************************************

S:OFF
 vAPP_GP_LoadPDMData PDM_ID_APP_CLD_GP_TRANS_TABLE u8Status = 1 u16ByteRead = 41225  4

 vAPP_GP_LoadPDMData PDM_ID_APP_CLD_GP_SINK_PROXY_TABLE u8Status = 1 u16ByteRead = 41225 400 address = 0x       0 0
eStatusReportReload = 0

 eCLD_ScenesCreateScenes: eCLD_ScenesCountScenes() u8SceneCount = 1
 before  vGP_RestorePersistedData Addr= 0x       0 0 Address = 0x4004780
sGP_PDM_Data.u32RestoreGPPDMInfo = 0 should not be 11
Resetting sink table
Resetting attribute values
Link key : 5a, 69, 67, 42, 65, 65, 41, 6c, 6c, 69, 61, 6e, 63, 65, 30, 39,

 vSink table address = 0x       0 0

S:ONMAKE Reportable ep 1
Cluster 0006 Attribute 0000 Min 1 Max 61 IntV 0 Direct 0 Change 0
Cluster 0008 Attribute 0000 Min 1 Max 61 IntV 0 Direct 0 Change 10

Set a random pan
BDB: Disc on Ch 11 from 0x02108800
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

And as you can see it starts the network steering at startup (just like the DR1175).

I should not have to press any buttons to start network steering. On a fresh startup it should do that automatically.

But that stopped working when building for DriverBulb_JN516X.c.

0 Kudos

599 Views
youpko
Contributor II

Hey Mario

The things I tried where setting the DR=JN516X and DR=WS2812. only change i made was in the makefile setting all the debug output on

But the JN-AN-1218 (DR= JN516X / WS2812) without any changes on my part won't even compile.

For DR=JN516X i can implement the vISR_Systemcontroller my self (just like on of the examples) and just leave it empty.

And then it compiles but I get a Bus Error on runtime. But I can't find the code for the DR1175 board setup, so my guess is that the AN is expecting a variable setup but which is not, because i compiled with JN516X.

So i have not found what is going on yet. but is there maybe a manual on how to write you own board implementation?

0 Kudos

599 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Youp,

What do you mean with because I compiled with JN516X.?

Did you look at the Driver Bulb folder inside the CommonLight/Source?

In the Build command, you should have the next command

make LIGHT=DimmableLight JENNIC_CHIP_FAMILY=JN516x JENNIC_CHIP=JN5169 GP_SUPPORT=1 DR=DR1175 GP_DEVICE=PROXY_BASIC

3. Developing an Application

Regards,

Mario

0 Kudos

599 Views
youpko
Contributor II

Hi Mario,

I want to compile the DriverBulb\DriverBulb_JN516X.c because that is the closed for what i need. And after reading through the makefile I figured out that if in the make command i put DR=JN516X then that file will be used to build the app.

But because that doesn't  I work i also tried to build with DriverBulb_WS2812.c (makefile command: DR=WS2812) but that had many compile errors.

So i am still struggling getting the example working.

But i want to thank you Mario for always helping me further.

On an other note can you also check this https://community.nxp.com/thread/498118 question I asked.

0 Kudos

599 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Youp,

You could create your c file a take as reference the DriverBulb_JN516X.c

2.3 Adding a New Source File

Regards,

Mario

0 Kudos

599 Views
youpko
Contributor II

Hi Mario,

I Tried to make my own DriverBulb_custom.c file (with DriverBulb_JN516X.c as reference) the but that has the same problem as the DriverBulb_JN516X.c I can get it to compile but than when I run it on the JN5168 Module it works for a second or two and then gives a Bus Error an the watchdog resets the chip (and this just keeps looping)

I even tried with my custom file just only empty function no actually PWM is set for example but even that doesn't work.

0 Kudos

599 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Youp,

It is possible that you can share your code that you modify step by step?

Now, are you working with PWM interrupt? What is the PWM that you are working on and also the DIO?

Regards,

Mario

0 Kudos

599 Views
youpko
Contributor II

Hi Mario,

I have not used PWM actually just trying to get the provided examples to work. the only thing i tried is to copy an example and just remove the code but leave all the function so the compiling works but no actually code is run. I tried that because the example doesn't work on its own.

Getting the correct PWM/IO working is the next step when I have figured out how to do it properly.

0 Kudos

599 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Youp,

I'm sorry for my misunderstanding.

For example, You want to add a new_custom.c file and set a DIO pin for example, and verify that this work without the bus error?

the only thing I tried is to copy an example and just remove the code but leave all the function so the compiling works but no actual code is run.

Remember some set up(Makefile and irq_JN516x.S ) a

Regards,

Mario

0 Kudos

599 Views
youpko
Contributor II

Hi Mario,

I specified DR=JN516X to the makefile, wich in turns disables any  "APPSRC += app_buttons.c"

And does DR=JN516X means that i dont want to use any expansion board?

Over the weekend I tried to enable and disable serveral things but the outcome is always the same Bus Error. (unless I build with DR=DR1175)

Can you recommend me a way how to debug this?

And where can i find what that Bus Error means?

0 Kudos

599 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Youp,

(unless I build with DR=DR1175) check the DIO set up, because the DR has some sensor and led that is set up.

Can you recommend me a way how to debug this?

Step by step, what are the changes that are you doing? However, I recommend looking at the JN-AN-1229 that is a ZPS Application template, you should add the files that you only need and the endpoint that you want.

However, if you do not want an empty example the JN-AN-1217 could be another option for you.

Regards,

Mario

0 Kudos

599 Views
youpko
Contributor II

The app_buttons.c/h are not used when not building a one of the demo boards examples (OM15045,OM15053,DR1175,DR1173 according to the makefile) so why does it try to link against the vISR_SystemController when trying to build the JN516X example?

And the only referense to vISR_SystemController (with the BeyondStudio search) is in APP_vSetUpHardware (app_main.c) but that is only enabled when using an JN517x and i use the JN5168 family.

As a first step i want to make a DriverBulb implementation that sets 5 pwm outputs of my JN5168 module.

My second step is to implement 5 endpoints that each set one of the 5 pwm channels. So one JN5168 module that registers as 5 individual dimmable lamps.

The demo boards have a lot more functionality than what is nescesary for my project. So am trying to figure out how i can remove the demo board code and replace it with my own needs.

As a start my idea is to write my own DriverBulp implementation that fits my PCB layout. And my way to do that was to use the most basic example JN516X because the other ones are for the demo boards.

But as stated in my orignal it seems to crash at run time, and i don't now how to decode the stack dump and figure out what goes wrong.

0 Kudos

599 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Youp,

It is possible, but you must do some other changes in the code. For example.

Some c files are using the buttons defines, in the make file you must comment or not define APPSRC += app_buttons.c.

Also, it will depend on the DR expansion board that is defined.

Do not comment on the irq_JN516x.s lines, you need to be sure that every DIO input function or trigger is not been triggered.  vISR_Systemcontroller has the lowest priority. If this interrupt is triggered you could debug and find out what is the module that is activating the callback.

Regards,

Mario

0 Kudos

599 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Youp,

The vISR_SystemController is supporting all the button Initialise.

Are you taking as reference the driver bulb, what do you want to add or change?

Regards,

Mario

0 Kudos