• AVR Freaks

Hot!RN4871 locking up (buffer overflow?) after ~960 characters

Author
MChiper
Starting Member
  • Total Posts : 29
  • Reward points : 0
  • Status: offline
2020/06/13 10:20:16 (permalink)
0

RN4871 locking up (buffer overflow?) after ~960 characters

This is happening with a RN4871 connected to an MCU, but I've narrowed down and reproduce the problem to an RN4871 on a breakout board connected to a serial terminal (via an FTDI adapter).
Hardware flow control is on (necessary for application).
Shortest path to reproduce it is:
- Reboot
- Enter command mode
- Send commands (I'm using "SHW,0075,1122334455\r")
- Repeat command
After 48 times, the RN4871 stops responding (and the P3_6/RTS line is high).
Doesn't make a difference whether it's connected to a mobile device or not.
I'm using FW v1.30
 
Am I doing something incorrect here?
Thanks
 
 

Attached Image(s)

#1

8 Replies Related Threads

    RISC
    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 13:35:41 (permalink)
    0
    Hi,
    check your schematics against the schematics in user manual (it uses MCP2200 instead of FTDI)
    http://ww1.microchip.com/downloads/en/DeviceDoc/50002547A.pdf
    My guess is that you use a speed > 115200. Is this right ?
    From what I remember, even though the datasheet shoes higher speeds, they may not be usable...
    BTW, you should really use the latest firmware v1.40 for development (or update your firmware).
    To make sure you get a module with v1.40 firmware order this reference : RN4871-V/RM140 or RN4871-I/RM140
    Regards
    #2
    MChiper
    Starting Member
    • Total Posts : 29
    • Reward points : 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 15:37:29 (permalink)
    0
    Verified my pin connections are the same as with the Pictail's MCP2200.
     
    I am using the stock 115200 rate (I didn't change it).  I was considering going faster later (after I get it working).  I can try slower, but my application is to update the firmware (up to 48k) on an ARM processor via this BLE module, so slowing it down will get painful.
     
    I was considering updating FW to v1.40, but I didn't see anything in the release notes that this is a known and resolved issue.  But I may have to try this to see.
     
     
    #3
    RISC
    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 15:47:23 (permalink)
    0
    Hi,
    I suggest you buy a RN4870 PICTAIL board because you can use it as reference and save a lot of time...
    When it does not work as expected you can verify if hardware or software is the cause...
    I strongly recommend you develop with v1.40 because it implements some security patches on bluetooth (even if it does not solve your specific issue)
    It is always better to develop with "final" firmware to avoid retesting 
    Regards
    #4
    MChiper
    Starting Member
    • Total Posts : 29
    • Reward points : 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 15:53:16 (permalink)
    0
    I will upgrade to v1.40 and try that.  But I'm traveling a lot and need to have this project wrapped up *soon*.  It's the only thing left to figure out.  Hoping not to have to buy a $90 board just to test this.
     
    #5
    tx
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2020/05/28 21:09:30
    • Location: 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 17:23:42 (permalink)
    0
    @RISC, One should not have to buy a reference design just to make the device work. The datasheet and the user guide should provide the details on how to make it work. However, the datasheet is incomplete and just plain wrong, since many critical modifications had to be done to the firmware, showing that the device is not reliable.
    #6
    MChiper
    Starting Member
    • Total Posts : 29
    • Reward points : 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 19:17:28 (permalink)
    0
    Dropping to 9600 baud did not work.  Nor did I expect it to... I was manually sending the SHW commands from a serial terminal at about 1 command w/16 data bytes every second.
     
    But changing to FW v1.40 seems to work... so far.  I've sent about a few thousand characters to it and so far it still works.  I'll have to figure out how to upgrade the FW on the board with the MCU to properly test an actual firmware file.
     
    On another note, I was following the firmware procedure in this doc (which the FW release notes directed me to)... http://ww1.microchip.com/downloads/en/DeviceDoc/50002547A.pdf
    On page 44, after step 6 (connect to com port), it goes to step 7 (verify the FW update was successful)... huh?  The actual meat of the procedure is missing.  I verified this is the latest version of that doc, so it's surprising that these things go unchecked for years.
     
    Appreciate the help...  Thanks!
    #7
    rogermorrell
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2012/09/18 14:37:12
    • Location: 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 22:26:38 (permalink)
    0
    I have tried up grading the firmware and the instructions did not say to verify - I tried and the verify failed  and the RN4871 did not work afterwards. I'm not sure if it is supposed to or not, there was possibly another reason for it not working.  My problem is trying to update when the RN4871 is installed on  production board and connected to the MCU as well as to a remote serial logic level connection from a PC, I did not/could not disconnect the MCU without modifying the board and it looks like you need to.   
     
    One very important piece of inform that is mentioned in documentation and shown in a sample circuit is to be very sure you have decoupling capacitors and I used also the MCP112 to hold the RN4871in reset if the voltage dips.  I did not do this in an earlier project and it was disaster with the RN4871 getting bricked.
    #8
    MChiper
    Starting Member
    • Total Posts : 29
    • Reward points : 0
    • Status: offline
    Re: RN4871 locking up (buffer overflow?) after ~960 characters 2020/06/13 23:34:29 (permalink)
    0
    I found other discussions explaining the FW-upload procedure.  I did get it upgraded to v1.40.  The "V" command confirmed that.  But v1.40did not resolve my problem.
     
    For whatever reason I could not get the RN4871 on the MCU board to connect/talk to a serial terminal (even wrote special code to leave all the UART-related pins as inputs), so I had to desolder it.  I'll have to tweak the circuit for production.
     
    Yes, I have very good decoupling (0.1uf close by, and 9.4uf directly on the RN4871 power pins).
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5