Author Topic: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error  (Read 14421 times)

0 Members and 1 Guest are viewing this topic.

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #75 on: October 16, 2017, 06:18:43 am »
Hi,As you said i tried to blink and LED in  iap_write_page() function of  bootloader section from application.
For this I called appWritePage() from application(the control in turn goes to iap_write page()). Also added the led blinking code in iap_write_page() function.   In linker script of bootloader I have
Code: [Select]
MEMORY
{
  text   (rx)   : ORIGIN = 0x0003f800, LENGTH = 256K-2K
  boot   (rx)   : ORIGIN = 0x0003fffc, LENGTH = 2K
  data   (rw!x) : ORIGIN = 0x00800190, LENGTH = 32K-500
}
Also In script the boot section is like this
Code: [Select]
  .boot :
  {
   
    *(.boot.switch)
   
    *(.boot.write_page)
    KEEP(*(.boot.*))
  } > boot

When I used ALIGN(256) it showed error that the address not fit in range.
In bootloader.c I defined
Code: [Select]
__attribute__((section(".boot.write_page"))) void (*iap_write_page)(uint32_t, uint16_t *) = iap_write_page_handler;
__attribute__((section(".boot.switch"))) void (*iap_switch)(void) = iap_switch_handler;

Also in created  led.h file  I have defined
Code: [Select]
#define STARTING_ADDRESS        (SYS_DEVICE_SIZE / 2)
#define IAP_SWITCH_HANDLER      (SYS_DEVICE_SIZE - 4)
#define IAP_WRITE_PAGE_HANDLER  (SYS_DEVICE_SIZE - 2)

here SYS_DEVICE_SIZE =262144 .So IAP_SWITCH_HANDLER points to 3fffc.I added LED blinking code in both iap_write_page_handler and iap_switch_handler.but nothing worked.
please clarify me the following
1) Do I need same linker script in application(tried with one but no use)
2)Do I need to specify
Code: [Select]
  .boot :
  {
    . = ALIGN(256);
    *(.boot.switch)
    . = ALIGN(256);
    *(.boot.write_page)
    KEEP(*(.boot.*))
  } > boot


If so i have to adjust iap address..Kindly suggest a solution
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #76 on: October 16, 2017, 06:21:40 am »
I will only answer once you explain to me the purpose of the ". = ALIGN(256);" statements. If you still don't understand it, you need to do more reading and experiments with linker scripts. Without this, the whole thing is a waste of time.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #77 on: October 16, 2017, 06:33:53 am »
ALIGN aligns the section to a particular boundary.here 256 bytes allocated for each of the iap functions.
I havent see in other linker script(atmega128rfr1) to align this section.If I have to use this I need to adjust iap address.thats why get confused
« Last Edit: October 16, 2017, 06:37:37 am by vishal »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #78 on: October 16, 2017, 06:36:30 am »
Well, can you answer your own question whether you need them here or not?

You will have to look at disassembler output and trace execution of the code. There is no way to avoid this. And once you see what actuall happens on hardware level, you will know what you need to change.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #79 on: October 25, 2017, 10:15:35 am »
Hi,
I started to debug.While debugging I found that the OTAclient response data is not arriving at OTA server.But in OTAclient it sends.but nothing hit in otaServerDataInd().I understood only after getting OTA_SUCCESS_STATUS from the client to server it starts to send blocks of bytes to upgrade.Here the initial OTA_SUCCESS_STATUS is not receiving and execution end after exceeding maximum try count.Checked the hardware with peer to peer code.both devices send and receive.no issue.but here client response is not hitting in server.The client can receive from the server.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #80 on: October 25, 2017, 04:56:47 pm »
As I said numerous times, forget about OTA and files and LwMesh for now. Make two projects.  One is a bootloader that contains certain function you need to call. The other one is a simple main() that calls that function. That's all you need to do now. That's how you debug.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #81 on: October 26, 2017, 05:10:21 am »
Yes..I did it.I wrote a blinkLED() in bootloader.c and called it from application.it worked.In bootloader.c  i have
Code: [Select]
__attribute__((section(".boot.blink")))void(*blink_led)(void)=blinkLED;
void blinkLED(){
 for(uint8_t i=0;i<10;i++){
   DDRD|=(1<<6);
   PORTD|=(1<<6);
   _delay_ms(100);
  PORTD&=~(1<<6);
 _delay_ms(100);

}

in application i have

Code: [Select]
static void *appGetIapHandler(uint32_t addr){

  void *handler;
  #if defined(__ICCAVR__)
  memcpy_P((void *)&handler,(void const __farflash*)addr,sizeof(void *));
  #else
  handler=(void *)pgm_read_word_far(addr);
  #endif
  return handler;
}

static void blink_led(void){

   blinkled_t blink=(blinkled_t) appGetIapHandler(BLINK_LED);
  ATOMIC_SECTION_ENTER
  EIND=1;
  blink();
  EIND=0;
  ATOMIC_SECTION_LEAVE
}


It worked.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #82 on: October 26, 2017, 05:18:59 am »
Ok, good.

The only thing to check is that APP_OTA_ENDPOINT is the same on both sides. Otherwise - debug.

But if I remember correctly, you have this part working already. What happened to that?
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #83 on: October 26, 2017, 05:24:30 am »
APP_OTA_ENDPOINT is set as 2 on both sides. Now the issue in the initial OTA_SUCCESS_STATUS not receiving in the otaserver....Also i tested to send some data to the server to see wther anythng hit in otaServerDataInd().but nothing is getting there.Hope that if it solved all other thing works.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #84 on: October 26, 2017, 05:27:46 am »
What "initial OTA_SUCCESS_STATUS"? This OTA is a request-response. What request is not getting answered?
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #85 on: October 26, 2017, 05:30:29 am »
The server is not getting any response from client.But the client can receive request and it sends response.That response not receiving in the server
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #86 on: October 26, 2017, 05:32:02 am »
What are the parameters of the NWK_DataReq_t that client uses to send the response, and what status code it receives in the confirmation handler?
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #87 on: October 26, 2017, 06:28:30 am »
It returns  NWK_NO_ROUTE_STATUS(0x11).


The parametrs set are
Code: [Select]
otaDataReq.srcEndpoint=APP_OTA_ENDPOINT;
otaDataReq.dstEndpoint=APP_OTA_ENDPOINT;
otaDataReq.options=NWK_OPT_ACK_REQUEST;
otaDataReq.dstAddr=otaclient.server;
otaDataReq.size=sizeof(OtaStartRespCommand_t)
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #88 on: October 26, 2017, 06:32:47 am »
I meant actual numerical values, I have the code. Does otaclient.server matches the actual address of the server?

I don't know basically, debug. Single step it and see what is failing and where.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #89 on: October 26, 2017, 06:36:37 am »
I meant actual numerical values, I have the code. Does otaclient.server matches the actual address of the server?


Code: [Select]
otaDataReq.srcEndpoint=2;
otaDataReq.dstEndpoint=2;
here otaclient.server address is 0x8555.I also tried it by directly giving it as otaDataReq.dstAddr=0x8555;but no use.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #90 on: October 26, 2017, 06:44:42 am »
This all looks ok. Having a sniffer would help a lot.

Without the sniffer, all you can do  is check why route is not found. Looks in the stack routing tables.

Also, try to set a different address (like 5) to the server.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #91 on: October 31, 2017, 05:23:21 am »


Also, try to set a different address (like 5) to the server.
I tried but no use with this address change.while debugging the NWK_NO_ROUTE_STATUS appear when we enable the  NWK_ENABLE_ROUTE_DISCOVERY in the application.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #92 on: October 31, 2017, 05:24:29 am »
I tried but no use with this address change.while debugging the NWK_NO_ROUTE_STATUS appear when we enable the  NWK_ENABLE_ROUTE_DISCOVERY in the application.
Do you enable this on both sides?
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #93 on: October 31, 2017, 05:44:19 am »
yes, I have enabled it on both sides.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #94 on: October 31, 2017, 05:45:51 am »
Well, then you will have to trace why the receiving side does not respond to the route request. It usually just works, so something is broken on your side.

You may want to start with a clear version of the stack/application, and apply your changes on top.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #95 on: October 31, 2017, 06:39:44 am »
I start it from beginning with a clear stack.Now the error I got is  NWK_NO_ACK_STATUS  and  NWK_PHY_NO_ACK_STATUS   
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #96 on: October 31, 2017, 06:41:03 am »
Your devices appear to have some hardware issues.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #97 on: October 31, 2017, 06:43:10 am »
but it will work for basic peer to peer to communication and WSNDemo..So can we confirm it to have hardware issue
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #98 on: October 31, 2017, 06:46:03 am »
but it will work for basic peer to peer to communication and WSNDemo..So can we confirm it to have hardware issue
Those applications perform multiple retries, and generally tolerant to lost data. Run WSNDemo and actually check status codes.

It is virtually impossible to get NWK_PHY_NO_ACK_STATUS on working hardware and in a clean environment.
Alex
 

Offline vishalTopic starter

  • Regular Contributor
  • *
  • Posts: 102
  • Country: in
Re: Atmel-8390-WIRELESS-AVR2054-Serial-Bootloader Upload Error
« Reply #99 on: October 31, 2017, 06:59:59 am »
I checked the hardware again with the basic WSNDemo application.It works fine.and returns NWK_STATUS_SUCCESS code.no issue has found in hardware.Then why i am getting NWK_NO_ACK_STATUS and NWK_PHY_NO_ACK_STATUS in OTA application
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf