• AVR Freaks

Helpful ReplyHot!BM70 UART not working

Author
Freya
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2017/03/05 23:52:58
  • Location: 0
  • Status: offline
2017/03/22 05:37:38 (permalink)
0

BM70 UART not working

I to all,
I tried to connect a BM70 module to a MCU using a UART port.
VBAT is connected to 3,3V
VDDIO is unconnected
GND is connected to board GND
BM70 TX to MCU RX
BM70 RX to MCU TX
RESET to 3,3V (MCU pin set to '1')
P20 set to GND or to 3,3V (MCU pin set to '0' or '1')
 
If P20 is set to '1', the module is visible to other devices, but connection fails
If P20 is set to '0' the module is invisible
 
In both cases I am not able to get any response from module. I try to send commands through TX (I see signals on scope), but I get nothing back (line always tied to '0').
 
Did I mistake something?
Is it right VDDIO is unconnected?
 
 
Thank you
Freya
 
 
 
 
#1
jeremyvnc@gmail.com
Starting Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2017/03/03 12:47:15
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/03/24 08:30:11 (permalink) ☄ Helpfulby Rbaragona 2017/06/02 20:46:24
4.25 (4)
I haven't used the BM70 yet, but if it is anything like the BM20 or BM62 or BM64, the UART is disabled in EEPROM by default.
You need to download the UI tool for the BM70 and configure it for UART commands.  It is actually pretty easy to do.  I beat my head against a desk using logic analyzers, oscilloscope, FTDI bridges, and even broke out the arduino to try to make it talk.  Sadly, no where in the documentation does it say that it is disabled by default.
Go here: http://www.microchip.com/wwwproducts/en/BM70
Download the software package: BM70/71 Firmware & Software Tools v1.06_0Bxx or the other one (which will be determined when you query the firmware version).  Also download the documentation for the eval board.  It gives step by step instructions for what setting pins to pull up or down and how to configure the EEPROM and load it using the above tools.
I'm actually quite happy with these modules for the most part once I got the tools figured out and my library to talk with it done.  Next is just figuring out what commands to send when.
 
Hope this helps.
#2
Freya
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2017/03/05 23:52:58
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/05/29 04:34:13 (permalink)
0
Hi to all,
I checked in the BM70/71 Bluetooth Low Energy Module User’s Guide and the only interface mentioned is UART with the following configuration:

2.4.1
UART Interface Characteristics
While operating in the programming mode, the UART can operate using the following
parameters:
•  Baud Rate: 115200
•  Number of data bits: 8
•  No parity
•  1 stop bit
•  No flow control

and

2.6.1
UART Interface Characteristics
While in the direct test mode, the UART can only operate using the following
parameters:
•  Baud Rate: 115200
•  Number of data bits: 8
•  No parity
•  1 stop bit
•  No flow control

and on datasheet is written: "SPI and I2C peripherals of the IS1870/71 IC can be enabled on the BM70/71 module by changing the default firmware. For more details, contact local Microchip representatives."

So, which interface should I use (UART, SPI or I2C)?


I configured my UART according to parameters reported above and MCU UART is correctly working, as I tested it without module and data were correctly sent and received.
I tried to put P2_0 both at 0 or 1 level and send READ LOCAL INFORMATION command (0xAA, 0x00, 0x01, 0x01, 0xFE), but I get no response at all, even if command is correctly transmetted (checked for it with a scope on MCU TX line).

Someone is using it without the evaluation board? With which interface and with which parameters?


Thank you
Freya






#3
UART_9000
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2017/06/01 00:47:47
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/06/01 23:24:50 (permalink)
0
Hello,
 
I have a problem with the Bluetooth Module BM70BLES1FC2 too. I want to configure the Module with minimum number of hardware connections. Whenever I input UART Signals into the HCI_RXD I get no answer on the HCI_TXD. The HCI_TXD is always HIGH. When the MCU starts, I set the P2_0/Mode and the RST_N to HIGH. Then I wait 100ms before I activate the reset for 2ms. P2_0/Mode is in this time HIGH and after then I wait 5ms before the UART comes. I input the following Hex values (0xAA, 0x00, 0x02. 0x01, 0x00, 0xFD) into the HCI_RXD input. Inside of the data packs I have a delay of 25us. I tested some other Hex data too, but I got never an answer from HCI_TXD. The baud rate of my UART is 115200 and I supply the Module with 3V.
In my second attempt I connect the RTS and the CTR pins to the MCU. When the RTS is LOW the MCU sends the UART Signal to the HCI_RDX. When the RTS is HIGH the MCU transmits a LOW on the CTR to receive the HCI_TXD Signal, this also doesn`t work.
 
I have send a Ticked to the microchip support and when they answer I poste it her.
post edited by UART_9000 - 2017/06/01 23:26:11
#4
Rbaragona
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2017/06/01 21:23:08
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/06/02 10:06:32 (permalink)
0
Hey Jeremy,
I'm seeing this same issue with the BM62 and I'm currently going through the same steps you described. I have tried reprogramming the flash and Eeprom, but the tools won't connect since the uart is not responding. What steps did you take to get a BM62 to communicate over UART?
Thanks,
Rob
#5
bkish
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2015/03/06 18:22:03
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/06/18 21:37:23 (permalink)
0
As of 6/18/17 I also have this issue. I am using the BM71.
 
Just as OP said, I have tried sending the "Local Information" command as recommended by the manual to test the UART communication. I have confirmed on the scope that I am sending (0xAA, 0x00, 0x01,0x01,0xFE) to the Rx pin on the BM71. My O-Scope automatically decodes the signal and verifies that those hex values are being sent successfully.

I am able to reset the BM71 into Application mode and Test mode. I can confirm this because P0_2 lights up solid when in test mode (This is also indicated in one of the manuals somewhere) and P0_2 blinks periodically when in application mode. I have tried sending the Local Information command in both modes, and I get no response from the TX line. It is continually held high.
 
My procedure:
  1. Do reset to Application or Test mode (Using specified delay times for boot process)
  2. Wait 2 seconds (This is to ensure the unit is completely booted)
  3. Send Local Information request out of the PIC into the BM71.
  4. Wait 4 seconds for a response (This is where I am looking for a response)
 
I include the several seconds to ensure there is not a timing issue such as sending another command before it is able to respond.
 
I do notice that the Rx LED Indicator LED lights up briefly on reset. It then goes away, maybe a 100ms duration. the Rx LED does NOT light up again after reset even when the Local Information request is sent.
 
Based on the fact that the Rx LED does not light up even when the Local Information request is being sent through the Tx line according to the data sheet, that it is not seeing the command.
 
I have also tried a baud rate of 9600, thinking maybe a new firmware update might have changed it for some reason. However, even at 9600 baud with all else held constant, it was a no go, in both application mode or test mode.
 
I also noted that when in test mode, I see STATUS1 LED = HIGH, and STATUS2 LED = LOW. However, in application mode I see both STATUS1 LED, and STATUS2 LED are HIGH. This is a little confusing because on page 23 of the "BM70/71 Bluetooth®Low Energy ModuleUser’s Guide" it states both, that a High/High state indicates "Power On" according to Figure 1-6, but then Table 1-2 states that High/High means it is in shutdown... So I am not really sure. But since the unit is not responding, I figured it is worth looking into. It goes on to state that in "Shut Down" mode that all internal functionality is shut off, and the only way to take it out of "Shut Down" mode is to configure the device to assign the Rx Indicator pin to "Wake Up" on the BM71.
 
I am thinking maybe, the unit needs to be put in test mode, programmed to enable the "Wake Up" pin instead of Rx Indicator, then switch back to application mode and use the "Wake Up" pin to turn the unit on after reset.
 
I am not even sure if the pin status can be changed in test mode, and I have not tested this, but I figure it is worth a shot.
 
I am using the PIC 16F18877.
 
My UART configuration is as follows:
Baud Rate: 115200 with 0.644% error
Transmission Bits: 8 bits
Parity: None
Stop Bits: 1
 
P.S. I am building my own circuit, so I don't have the ability to use the tools mentioned above, but I am guessing that since the dev board is using a MCP2200, that somehow the chip is being programmed directly though the UART, and I assume the same can be achieved using a PIC instead, but we just have to figure out the commands.
post edited by bkish - 2017/06/18 21:40:20
#6
bkish
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2015/03/06 18:22:03
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/06/18 23:15:29 (permalink)
5 (1)
Ok, I got a response FINALLY, but I am not sure exactly what it means.
 
So I was looking at the "Explorer 16 BM70 Pictail Stopwatch" project, which can be found here:
http://microchipdeveloper.com/ble:bm71-app-example-stopwatch-demo
 
After going through their code I was able to get a RESPONSE FROM THE TX LINE!
 
NOTE: I sent this while in "Test Mode" which is achieved by dropping the reset line low for 1ms, while holding the system configuration pin to low for a minimum of 24 seconds. This is the snip it code I use to change modes for a reset:
 
 

<CODE>
typedef enum
{
    APPLICATION,
    TEST,
} mode_Type;
 
void PulseRSTPin()
{
    RST_SetLow();       //Set the reset pin low
    __delay_ms(2);      //A reset pulse must be greater than 1ms
    RST_SetHigh();      //Pull the reset pin back up     
    
}
 
void ModeSelect(mode_Type mode)
{

    switch(mode)
    {
        case APPLICATION:
            SYS_CON_SetHigh();
            break;
        case TEST:
            SYS_CON_SetLow();
            break;
        default:
            break;
    }
    
    PulseRSTPin();              //Reset the device
        
    __delay_ms(100);             //Wait a minimum of 24 seconds for mode to be detected
    
    SYS_CON_SetHigh();          //Reset P2_0 pin to high state
    
    __delay_ms(100);             //Wait a minimum of 43ms for UART to activate after reset
}
</CODE>
 
So in their code, one of the first hex strings they send is:
0x01,0x05,0x04,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
 
due to my function, my code was adding a 0xE9 for the checksum, so my PIC actually sent this:
0x01,0x05,0x04,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xE9 (Verified by a O-Scope)
 
BUT the 0xE9 is not part of the string of hex values in their project. My code added the 0xE9 because it auto generates a checksum. So I am not sure if it is needed, or if it is messing anything up. I am also not sure if the checksum is somewhere in that string, and maybe the 0x00's are just null? Not sure...
 
I don't fully understand what this string of hex does, but it is commented as "//Access command packet". At a glance I can not identify the command it is, or which values relate, or why there are so many 0x00 in it. BUT it did produce a response. According to the project the expected response is:
0x04,0x0F,0x04,0x00,0x01,0x05,0x04,0x04,0x03,0x0B,0x00,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00
 
But I only got part of this string back:
0x04, 0x0F, 0x04, 0x00, 0x01,0x05, 0x04 (Verified by a O-Scope)
 
I have no idea what these commands are doing, but it is a big step forward.
 
They do NOT send 0xAA first. When I tried to send 0xAA before any command I was getting no response at all. So I think there is something that I am missing. It is labeled as a "SINC WORD", but I can't find any other reference to it. I assumed it was the beginning character to start a command, but at least for the command above it doesn't seem to be used.
 
Also, this is one of the first hex strings they send, so it could be some kind of opener, or initialization string, that allows for commands to be sent, which might be why the string does not have 0xAA or any easily identifiable checksum. Just wanted to note that. I will look into other commands they send and see if they include 0xAA or not at the beginning.
 
I will update again if I find out more.
 
I sent that string through my function (See code below) and I got a response from the Tx of:

Also, this is the function I wrote to send the command:
<CODE>
void SendPacket(uint8_t *packet, uint8_t size)
{
    uint8_t checksum = 0;        //Start the checksum with value 0xFF as required to calculate the checksum
    
    for(uint8_t i = 0; i < size; i++)  //Send the command bits, along with the parameters
    {
        EUSART_Write(packet);    //Send each byte in buffer
        checksum += packet;      //XOR each byte to the checksum using the "^" command
    }
    
    checksum ^= 0xFF;                   //Add one to the final value of the checksum as per checksum protocol
    
    checksum += 0x01;
    
    EUSART_Write(checksum);         //Send the checksum value
    
    //btBuffer_Ptr = 0;
    //To calculate the checksum you first set the checksum to 0xFF, then you XOR each byte
    //To the result of the checksum "byte ^ checksum" then after all bytes have been xor'ed to
    //the checksum, you add a value of 1 to the final result. This gives you the final checksum.
}

</CODE>
#7
bkish
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2015/03/06 18:22:03
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/06/19 07:30:04 (permalink)
5 (1)
UPDATE:
After going back and changing some code I found that the BM71 did not respond when the checksum was added to the string of hex values.
 
I have also learned more about what is happening.

There is a set of Hex Strings that are sent to the BM71 in "Test" mode NOT application mode, that allows the Flash memory to be programmed. Here are the string commands:

Allow access to flash memory:
String Sent:
0x01,0x05,0x04,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
Expected Response:
0x04,0x0F,0x04,0x00,0x01,0x05,0x04,0x04,0x03,0x0B,0x00,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00
 
Erase flash Memory:
String Sent:
0x02,0xFF,0x0F,0x0E,0x00,0x12,0x01,0x0A,0x00,0x03,0x00,0x00,0x40,0x03,0x00,0x00,0x20,0x00,0x00
Expected Response:
0x04,0x13,0x05,0x01,0xFF,0x0F,0x01,0x00,0x02,0xFF,0x0F,0x0E,0x00,0x12,0x01,0x0A,0x00,0x00,0x00,0x00,0x40,0x03,0x00,0x00,0x20,0x00,0x00
 
End Flash Memory Access:
String Sent:
0x01,0x06,0x04,0x03,0xFF,0x0F,0x00
Expected Response:
0x04,0x0F,0x04,0x00,0x01,0x06,0x04,0x04,0x05,0x04,0x00,0xFF,0x0F,0x00
 
The "User Interface (UI) Configuration Tool" generates a text document with the specified configuration you chose then is processed through the function below.
 
I plan on sitting down and trying to pinpoint which addresses change which settings, by changing one setting at a time in the program, then comparing the text file exported. If anyone knows where the documentation is that explains what memory addresses in the flash program what feature please let me know. For now, I plan on experimenting and comparing files to determine which address correlates to which functionality.
 
Doing so will allow the changing of specific features in the flash without having to upload the full configuration file to the PIC, or loading it from a file on the drive to an array in the code.
 
Then specific flash memory at specific addresses are written to using this function:
<CODE>
//int8_t cfLocalProgramConfiguration(void)
//{
//    uint16_t i, j, k;
//    uint16_t address;
//    uint8_t dataOut[128], *ptrDataOut;                                          //Packets contain 128 bytes of data (after the 19 byte preamble))
//    
//    address = 0;
//    for(i = 0; i < 512; i += 8) {
//        ptrDataOut = &dataOut[0];
//        for (j = 0; j < 8; j++) {
//            for (k = 0; k < 16; k++) {
//                *ptrDataOut++ = configFlashTable[i+j].data[k];                  //Get a byte to program and add it to the data to write
//            }
//        }
//        if (cfLocalWriteFlash(address, dataOut) == FALSE) {                     //Send command to write configuration flash and get response
//            SYS_DEBUG_BreakPoint();                                             //Debug
//            return FALSE;                                                       //Failed to read configuration flash
//        }
//        address += 128;
//    }
//    return TRUE;
//}
</CODE>
#8
bkish
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2015/03/06 18:22:03
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/06/19 07:36:52 (permalink) ☄ Helpfulby ernismur 2019/03/07 12:03:59
0
So it looks like what needs to be done, is the flash memory that holds the settings for the firmrware on the BM71 needs to be manually changed in the flash memory to change its settings. Since I believe that the BM71 is going directly into "Power Off / Sleep" mode when activated in application mode (Due to both Status pins being high) AND that the only way to take it OUT of power off mode is to change the Rx indicator functionality to "Wake Up" I am looking into changing the settings of the firmware for that pin. Since by default (On the BM71 at least) it is Rx Indicator, instead of "Wake Up".
 
I feel like IF this IS the case, that this is a huge oversight by Microchip to make a BM71 module that instantly goes to sleep and can not be accessed due to the "Wake Up" pin not being present on the hardware at start.
#9
rberanek
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2017/09/19 16:06:32
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/09/22 11:52:40 (permalink)
0
I am seeing a similar issue where i am sending data (confirmed via logic analyzer) and not receiving any replies.
My guess is I am not entering test mode properly. But I find the Figure 2-13 from the datasheet confusing.

Does P2_0=1 after 25 ms to enter test mode or the opposite? I am managing P2_0 and the reset pin with external jumpers. Currently I am just holding P2_0 low on startup to enter test mode, but I do not receive anything on the Rx line with this procedure.
 
I have tried sending the standard hex strings (e.g. 0x01) to get device information, as well as the flash access (0x01,0x05,0x04,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00).
 
When I power up with P2_0 held high, I am able to see the standard bluetooth configuration on my smartphone. So this indicates the chip is working.
 
#10
RISC
Super Member
  • Total Posts : 5376
  • Reward points : 0
  • Status: offline
Re: BM70 UART not working 2017/09/23 03:53:18 (permalink)
0
Hi,
Unless you really need the BM71 low level access to API, I strongly recommend that you use RN4871 which is much easier to use. It is the same physical module than BM71 but the firmware is different. RN4871 has a command parser which makes it easy to control. RN4871 UART is activated by default.
Regards
 
#11
rberanek
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2017/09/19 16:06:32
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2017/09/23 05:24:50 (permalink)
0
Thanks for the quick reply. Moving to another chip is not an option now as we are working with an existing PCB already.
 
I am also unable to connect via UART to my PC to use the firmware update (note I am using an USB-FTDI converter with a 3V setting) or setup utilities which further indicates that there is an issue entering test mode and activating the UART.
#12
RISC
Super Member
  • Total Posts : 5376
  • Reward points : 0
  • Status: offline
Re: BM70 UART not working 2017/09/30 06:44:00 (permalink)
0
Hi,
As I mentioned, you actually do not need to change your current module (BM71) to reprogram it with RN4871 firmware, as both use the same hardware (I have done it a couple of times).
Is you use the RN4871 firmware update utility you can install its firmware on the BM71 module.
RN4871 is much more easier to interact with due to its ASCII commands ;=)
Regards
 
post edited by RISC - 2017/09/30 06:45:46
#13
ernismur
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2019/02/27 08:39:01
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2019/03/12 10:58:59 (permalink)
0
Bump.
I enter in manual mode properly I guess (Led is on and stop blinking). I send commands: open flash, read flash and close flash, I get an answer. But when I'm trying with commands like Read Local Information still not working, with and without sync word (0xAA) and checksum. Anyway, none of the Command set protocol works for me.
 
P.D. I´m using this module through PIC24FJ128GA308 on a PCB, I don't have PICTAIL.
 
Please help me :(
post edited by ernismur - 2019/03/12 11:02:49
#14
sivaramnadh d p
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/07/03 01:54:11
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2019/08/26 04:03:23 (permalink)
0
Hiii,
I am trying to connect attiny1616 MCU with BM70 module.I have used a bluetooth terminal app in my phone and tried transmit a "Hello" from the MCU. BM70 get connected with my mobile phone. But it doesnt displaying a data. What may be the reason. Is it possible to transfer data like this?. I havent changed any setting in BM70. configuration maintained as high during all process.
 
#15
sivaramnadh d p
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/07/03 01:54:11
  • Location: 0
  • Status: offline
Re: BM70 UART not working 2019/08/26 04:04:55 (permalink)
0
Whether BM70 can serve the same function as HC-06 did?
#16
Jump to:
© 2019 APG vNext Commercial Version 4.5