Smart Bluetooth Forum Discussions
I have obtained a couple of these devices and wish to write an application (using Cordova). I have discovered a bunch of non-registered UUIDs. Where is the list of what these are and what can be done with them? I imagine I could find this in the android or IoS sources but there has to be a better way.
Show Less1.how to config RTC use external 32.768?
Find in rtc.h,but i can`t find how to config.
2.Is there a function that i can regeist the RTC interupt for seconds function?
Show LessDoes 20732 chip need a external 32.768 crystal? I had thought the 32.768KHZ crystal is used for advertising when chip in sleep mode, but it seems not, when I take out the crystal, it can still enter into sleep mode normally, then what on earth this crystal used for?
Show Less===
SDK: 2.1.
Tag: 920737.
app: hello-sensor.
OS: Android smarphone
Download size ~ 25KB
NV size: need to use "8KB"
===
We need to enlarge our file system(NV) size in btp file as
DLConfigVSLength from 1024(1KB) to 8KB but
system seems to fail storing data to NV; I wonder that
how the max. size of NV (DLConfigVSLength) can I adjust in
SDK2.1 with 920737S? smaller than 8K?
Yes, you can debug with UART !
Several people have asked: "Can I have debug trace?" "Can I use anything for debug?" For instance: "Can I use UART LOG and my messages for debug?" on WICED Sense - YES, you can !
Two lines of code and it works !
What to do?:
- Add to your WICED Sense FW such code:
void wiced_sense_connection_up(void)
{
//initialize the UART: here just when connection is established
puart_init();
puart_print("WICED: Connected\r\n");
- Open TeraTerm (or any other UART terminal on PC, WICED Sense connected via USB to it, using VCP (find devices on Windows Device Manager, e.g. which COM port is assigned for the terminal program later):
Baudrate: 115200, 8 bit, no Parity, no Flow Control, 1 Stop bit
Make sure, the TeraTerm is just started if USB connection is there and remains there and not interrupted. If a new power cycle, USB was down in between - you have to restart TeraTerm.
What to know?:
- The puart_print() does NOT translate "\n" into "\r\n" on UART. You have to code strings as "something\r\n".
- When you will configure UART (e.g on wiced_sense_connection_up() ) - it is up to you. I do not know when MCU is on, UART init persistent or lost (see more questions below). I have assumed: if connection is established - MCU remains on (see also below).
If UART is initialized, e.g. in startup - no idea what happens: it might be that MCU goes to Deep Sleep and UART is lost when back. - And: if you have rebooted device, e.g. battery removed - you must close and restart TeraTerm: a lost connection is not realized on TeraTerm. Maybe you have to be a bit quick: when LED is On on \WICED Sense: start TeraTerm, establish connection, see the message. But then it should be fine. I guess: if WICED Sense goes to sleep but you have not yet established connection and UART does not work - start over.
How to use?:
I have attached here my "wiced_sense.c" file which uses this feature. UART is enabled on "connection_up". I use a static variable to make sure the UART is not used if not initialized.
And: you and me, we want to print also variables, values, like a regular printf. Here it is - define a macro which you will use in your code:
static int sUARTInitialized = 0; //UART will be initialized on BLE connection established
//define a macro for a debug print similar function
static char sUARTBuf[80]; //a buffer for the UART output, used by Tprintf
#define Tprintf(fmt, ...) do { \
if (sUARTInitialized) { \
sprintf(sUARTBuf, fmt, __VA_ARGS__): \
puart_print(sUARTBuf); \
} \
} while (0);
Please, do no forget to set sUARTInitiazed when init was done.
So, later in your code you can use:
puart_print("WICED: Connected\r\n"); //use directly, as simple string
or:
Tprintf("WICED: Disconnected\r\n", 0); //OK, a bit strange, see below why do we need a parameter
You can print simple strings, you can print strings with variable content etc., like a regular printf.
Remarks
- The dummy parameter is needed on Tprintf in case just a formant string w/o any parameter needed:
The WICED Sense SDK does NOT use the latest GNU ARM compiler. It has a bug or does not support really the C99 language version. Even __VA_ARGS__ on macro seems to work - I have never seen this problem (using without the ", 0" - you will get a compiler error). - Bear in mind that puart_print() does not translate "\n" into "\r\n" (not as a regular C-string processed): add "\r" to all your strings.
I've seen a couple of posts that suggest that P0 can cause deep sleep to be terminated, because the keyscan causes the device to wake up.
One developer resolved his excessive current draw by pulling P0 high.
I don't plan to have any keys, I'd prefer to leave P0 with no connection or use it as an output.
For deep sleep to continue without interruption, if P0 is programmed as an output, does it still need to be pulled high?
Show LessSo I'm using the TAG board with the 737 on it, plugged into my pc & sending bytes to the board using RealTerm.
Here's my simple (flash the gpio led whenever the callback is called.) puart code:
void my_puart_interrupt_callback(void* unused)
{
// There can be at most 16 bytes in the HW FIFO.
char readbyte;
// empty the FIFO
while(puart_rxFifoNotEmpty() && puart_read(&readbyte))
{
if(gpio_getPinOutput(14/16, 14%16))
gpio_setPinOutput(14/16, 14%16, 0);
else
gpio_setPinOutput(14/16, 14%16, 1);
}
// clear the interrupt
P_UART_INT_CLEAR(P_UART_ISR_RX_AFF_MASK);
// enable UART interrupt in the Main Interrupt Controller and RX Almost Full in the UART Interrupt Controller
P_UART_INT_ENABLE |= P_UART_ISR_RX_AFF_MASK;
}
Weird thing is, as I'm slowly typing characters into the terminal & can see the led flash on the FTDI driver chip, the LED from the 737 only toggles every other or every few bytes. Why isn't it toggling with every byte received?
hi all
i need to use math library for my application ..
but for every function call like sqrt(), atan() sin() i m getting undefined reference error like below
C:\Users\knayak\Documents\WICED\WICED-Smart-SDK-2.1.1\WICED-Smart-SDK\Wiced-Smart\spar/../../Apps/hello_sensor/hello_sensor.c:468: undefined reference to `sqrt'
make.exe[1]: *** [../../build/hello_sensor-BCM920736TAG_Q32-rom-ram-Wiced-release/A_20736A1-hello_sensor-rom-ram-spar.elf] Error 1
makefile:152: recipe for target '../../build/hello_sensor-BCM920736TAG_Q32-rom-ram-Wiced-release/A_20736A1-hello_sensor-rom-ram-spar.elf' failed
Makefile:329: recipe for target 'hello_sensor-BCM920736TAG_Q32' failed
make: *** [hello_sensor-BCM920736TAG_Q32] Error 2
i included #include <math.h> in the source file
i could see that the build system can not able to link to libm.a (which is a math library)
this build is using arm-none-eabi- cross toochain. i came to know that to link to math library i have to add "-lm" flag
but i really dont know where to modify..
can anybody faced this issues. or have any solutions pls help .
thanks in advance