Smart Bluetooth Forum Discussions
Looking for the schematic for the red sense board module.
Hey,
I used puart_print and puart_wirte to send data from tag3 board on peripheral uart to another host MCU via uart.that is set to be
115200/8/n/1.I have also boosted the tag3 board VCC to 3.0V because my host MCU is powered by 3V.
So far tag board can receive data reliably form host MCU as SOC is configured to be Rx interrupt driven.
However I did not use Tx on SOC to be interrupt driven but just used puart API calls like puart_print and puart_write functions.
As observed from trace log on my host MCU side, occasionally the sent packet from SOC could have missing byte(s) (framing error) .
I have read puart_print and puart_write a bit on other Wiced projects' examples, and noticed that this two function will be blocked if tx FIFO is full. from my setup to my host MCU, I did not use HW flow control since host MCU cannot avoid extra signal pins as other GPIOs pin has been assigned for other host MCU control application, so HW flow control cannot be an option.
How and what can 1 do to setup SOC for Tx interrupt driven like the Rx is set for interrupt too? Please send me any example codes to setup TX for interrupt driven.
See below my usage of puart_print and puart_write, I use fine timer tick routine to poll for data exhange by sending host MCU as request commnad and enable RX interrupt after sent by using puart_print or puart_write, the fine time is ticked at 500ms periodically.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// It will be called every fine timer tick at every 500ms time interval.
void mybeacon_manage_timer_fine()
{
//Todo: do you actions here every fine timer tick
// Poll for host mcu for data exhange ie, occupancy/unoccupancy heat and cool setpoints per 100ms
// Data exchange objects are listed in Config_Cmd lookup table
BOOL Status;
// exit if not in BLE application config mode or DE update is in progress
if (BleAppControl.Mode != BLE_CONFIG_MODE || bBleAppDEUpdateinProgess)
return;
if (BleAppConfig.bLocked)
{
BleAppLockDuration++;
ble_trace1("BleAppLockDuration: %d\r\n", BleAppLockDuration);
if (BleAppLockDuration % MAX_BLE_APP_LOCK_DURATION)
return;
// unlock to resume normal scan operation,
// however the last scan request will be discarded
BleAppConfig.bLocked = FALSE;
}
// clear Rx interrupt
P_UART_INT_CLEAR(P_UART_ISR_RX_AFF_MASK);
// flush Rx FIFO
while(puart_rxFifoNotEmpty())
{
UINT8 readbyte;
puart_read((UINT8*)&readbyte);
ble_trace1("flush Rx FIFO: %c\r\n", readbyte);
}
BleAppConfig.Id = (BleAppConfig.Id+1)%MAX_BLE_CONFIG_ID;
ble_trace1("BleAppConfig.Id: %d\r\n", BleAppConfig.Id);
BleAppConfig.bSet = GET_CFG;
BleAppConfig.bWaitAck = FALSE;
BleAppConfig.bCrcEnabled = FALSE;
BleAppConfig.Crc32 - 0;
if (Status = (BleAppBuildConfigCmdString(&BleAppConfig)))
{
// send SoC request for config data
// Note: break string down to CFG_CMD_BUFSZ bytes per send if size > CFG_CMD_BUFSZ bytes
// or make it simply fit into CFG_CMD_BUFSZ-2 bytes for config caommad
// (1 for LF, 1 for CR, make command string size to be 16-2 = 14 bytes)
if (BleAppConfig.Size <= sizeof(BleAppConfig.StrBuf)-2)
{
puart_print(BleAppConfig.StrBuf);
puart_print(LF_CR);
// clear StrBuf after send for saving received response
memset(BleAppConfig.StrBuf, 0, sizeof(BleAppConfig.StrBuf));
BleAppConfig.Size = 0;
// lock next poll for DE data variables until response is received
BleAppConfig.bLocked = TRUE;
// enable UART Rx interrupt in the Main Interrupt Controller
P_UART_INT_ENABLE |= P_UART_ISR_RX_AFF_MASK;
}
}
}
Show LessHi,
i have problem with fine timer ( 20737 + SDK 2.2.1).
When timer ( for example 100 ms or any ) is started ( on new empty project ) there is only few timer interrupts and then BCM goes to some hold or locked mode.
I use puart to debug and if i put print line in timer it looks like:
Timer start
0B000000000007021F00000000@$*#04FF1EF700920103000007362A0A00640000073A2A080000000007522A5000010đţ
Timer test cycle
Timer test cycle
Timer test cycle
@$*#04FFF6F70092032C7A0100362A100073200001000000002000508900000A00000000000000070010070F000F220000200000000000002A00008003BE1A000000008003AE1A040000008003B21A020000008003B61A050005008003BA1A032.. This data extends about 70 kb and after finishing transmitting BCM goes to sleep/locked/freeze mode.
It is same if i use led blink, buzz, or just leave timer interrupt empty.
Thanks.
Show LessHi,
I need the solution for floating point support for BCM20737S
When I declare a float variable(in global) for example (float id=10.5;)It showing the following error "undefined reference to `__aeabi_f2uiz'" in WICED smart ide2.2.1. at the same time when i declare the float variable in Local It not showing error but it print the output in terminal only "ffffffffff" instead of 10.5. For printing i used the following method. ble_trace1("Out:%f\n",id); please give me the exact solution for print and access of float variable.
Show LessHi,
I have the following problem and don't know how to solve it:
I have to modules, a sensor and a client. Both require security and should bond.
- both are bonded.
- if I flash a new software on the sensor, the client can connect to the client, but on the sensor, the client is not bonded again (the client holds the bonding-information)
On the sensor I call lesmp_sendSecurityRequest(); But it seems, they just encrypt the connection, but don't bond again. How can I achieve a new bonding?
Show LessThis came in via email from gcohler, but I thought it may make sense to post here since the documentation for the ADC functionality is very limited:
===================Begin
We’re confused about the situation with reference voltage for the ADC, so I was hoping you could point me in the right direction.
Three things I’m confused about:
- The API for SetReferenceVoltage(pin, voltage).
- I believe (but am not sure) that, when called, the API takes a measurement of the pin specified, then computes the ratio between the raw ADC value and the number of millivolts specified to create a conversion factor between the raw ADC value and the millivolts value. And then saves that conversion factor for future use when adcRead() is called.
- In other words, it is purely a software thing, and that it does not actually use that pin as the external hardware reference voltage for the ADC operation.
- Reference Voltage(s):
- I believe (but am not sure) that there is at least one internal voltage reference inside the chip. But from the limited docs I can’t be sure. And there may be more than one.
- If for example, I wanted to use the 1.2V core voltage as the reference, is that possible? Is there an API to select this? There are three bullets that talk about different impedances based on different voltage ranges. So that implies that there are three different references that I can use: VDD, 2.4 and Vcore.
- If I call the SetReferenceVoltage API (for example with P15), does that make P15 an external reference for the ADC in a hardware sense? I’m thinking no, but not sure.
- The different ADC Modes (table 1). Are these really just different sample and hold rates? So if I go to low-frequency sampling, I get better precision. Or is there more to these modes. There isn’t really any description of what the modes mean.
Thanks very much for any light that you can shed on this. I have a customer that wants to use 1.2V as the reference. Hence my curiosity.
Show LessI''m investigating using PUART-Control in a battery powered sensor (BLE Peripheral role) application. However, I see that the sample application is for use as a Master (aka Client). Is there a version of PUART-Control that can be a BLE peripheral? We're seeing some demand for this, so that people can load one firmware image on the '20737 and then implement the application specific code in their host MCU.
Thanks,
Derek
Show LessI am using AIR_GPIO_RegisterInterrupt(13, myCallBackFunc13, AIR_GPIO_TRIGGER_FALLING_EDGE );
and
void myCallBackFunc13() {
iWasInturrupted = 13;
AIR_BLE_SetDiscoverable(true);
}
now my interrupt pulse is active low but only for about 20-30 ms. I am unable to reconnect the BLE in time to send the event trigger data.
Does anyone know how long the AIR_BLE_SetDiscoverable(true) should be true for it to be sufficient to sent this info.
I was hoping the easiest solution would be to add a delay in the myCallBackFunc13 to ensure there is enough time to do this.
Anyone experience anything like this? Any other software workaround to ensure this works smoothly? I guess because i designed the BLE device to be off always but for the interrupt times to save battery is the issue.
Show LessHi tjaekel
Per the thread you created here: WICED Sense debug with UART
even after a long time and discussion closed, I would like to thank you for sharing this.
Even if this is not a real debug board, if it is possible then why not.
It helps my case where I don't know what is happening and the Tag can't connect and loses connection quickly.
I don't understand the answer from Mr mwf_mmfae what is the link with your finding. Anyway, for all the readers that end up on this thread, in case they have the same blocking point as me, I remind some important steps:
- remove the battery and disconnect, reconnect usb to be able to flash updated soft
- remove usb
- set the battery as when usb is set, the wake button doesn't work (at least not for me)
- reconnect usb : only then you can open the terminal tool for port log display
- if using android and combined with Android issue, then additionally to those steps, pair with the phone as soon as the battery has contact
This is a nice exercise for hands agility if you want to have a log early on Tag startup.
additional hint, I have set a point Tprintf(".", 0); in the fine timer and a dash Tprintf("-", 0); on the tx opportunity,
now the Tag behavior monitoring can really start
Wassim
Show LessHello,
I want to know about routing of BCM20737S, I have read on datasheet this IC need keepout area around it. There are four sites of keepout area, i have some components and i want to place it on "side B" after keepout area can i do it. Since my pcb is very small i have moved ground L shaped plane to inner layer. Can you tell me the exact location of antenna in the IC? Thanks
Rashid