PSoC™ 4 Forum Discussions
Hello,
I am working on an existing project which uses BLE services. A BLE component was defined in its design.
In order to implement a OTA functionality in the existing project, I created a Fixed Stack Bootloader Project in the workspace, configured it (as well as the existing project to be bootloadable) using the AN 9706. I then followed the instruction from the "BLE OTA Fixed Stack Bootloader and Bootloadable"for adding service to the bootloadable:
I first added the APIs needed by the bootloadable in the linker Script of the bootloader cm0gcc.ld (eg KEEP(*(i.CyBle_Start)))
Then, ran the mk.bat file to generate the bootloadable linker Script BootloaderSymbolGcc.ld
My problem is now that I should add the used BLE APIs as extern declaration (as well as the BLE types and defines) to the OTAMandatory.h file of the bootloadable project. That is where I am stuck because I do not know how to do that and I did not find example projects on the forum with the bootloadable using BLE services.
Thank you in advance.
Show LessI am a newbee, using Cypress BLE pioneer kit CY8CKIT-042-BLE and currently working to make SW2 button to have control of start/stop advertising. Many of Cypress examples have demonstrated how to awake BLE from sleep and start advertising, but how to stop advertising is not been discussed.
Has anybody tried stopping the advertisement of BLE or is there any other sample project in which this use case is implemented.
Kindly reply.
Thanks.
Show LessI have been developing code in Creator 4.0. I have a module (C file) that I have used a lot, including the setting of breakpoints. After upgrading to 4.1 those breakpoints disappear after the debugger starts.
Rich
Show LessHi all,
I know it should be simple and straight forward to use the UART and I have not had any issues using it on PSOC 5 architecture.
However, now I'm using the PSOC 4 and it's slightly different.
I use PSOC creator version 4.1 Update 1 (4.1.0.3210). UART is version 3.20.
Target device is CY8C4024-LQI-S401 (4000S family).
It's a very simple implementation, I placed an UART block using the BASIC config.
In the advanced tab I changed the buffer size for rx and tx to 80 bytes each. Interrupts set to internal - so I'm assuming these are handled by the cypress software for the UART - and that I don't need to confirm/clear any interrupt flags in my app.
I use the UART_Start() to initialize UART.
I then use the UART_SpiUartGetRxBufferSize() and the UART_UartGetByte() functions to poll data from UART buffer.
As I understood all posts I have been reading about the UART this should be the way to do it.
Now, my question to this forum.
When setting breakpoint below the if-statement in the example code below, the UART_SpiUartGetRxBufferSize() always returns 1 and the UART_UartGetByte() always returns 0x000000FF.
What is it I don't understand here? If nothing has been received the buffer size should be zero?
The hardware RX line is pulled up and at 3.3V.
I also did some experimenting activating a handler, intercepting the RX_FIFO_NOT_EMPTY interrupt and it kept firing all the time.
Example code from my project:
First UART_Start() is called (which internally callse UART_Init() and UART_Enable().
void uartRxFrameHandler( void )
{
uint16_t stat;
uint8_t RxByte;
uint32_t rxDword;
if( 0 != UART_SpiUartGetRxBufferSize() ) // Any data in rx buffer?
{
rxDword = UART_UartGetByte(); // Rx status is embedded with received dword
stat = (uint16_t)(rxDword >> 8); // Get status
RxByte = (uint8_t)(rxDword & 0xff); // Get the received byte
...
/* Received data processed here - not relevant for this example */
...
}
Looking forward to some input on this since the problem totally eludes me.
BR
Michel
I have got the CY8CKIT-037 PSoC 4 Motor Control Evaluation Kit (http://www.cypress.com/documentation/development-kitsboards/cy8ckit-037-psoc-4-motor-control-evaluation-kit) and the CY8CKIT-044 PSoC® 4 M-Series Pioneer Kit(http://www.cypress.com/documentation/development-kitsboards/cy8ckit-044-psoc-4-m-series-pioneer-kit).
I read that you are advised to use the CY8CKIT-042, but can I also use the 044 and how would I do this?
Show LessThe "CY8CKIT-042-BLE Kit Complete Setup" installation comes with a couple of hex files to program a PSoC 4 BLE device for DTM testing.
Can anyone please confirm if the TX is set to max output power (+3 dBm) in these hex files? Something lower?
Thank you!
Show LessI am using the CYBLE-222014-01. P3_4 is used for the Advertising LED, and was configured as Digital Output (to be used as a current sink), but Psoc Creator says the assignment is invalid due to a HOTSWAP requirement. What exactly is that? When I configure the pin as bidirectional, the error goes away. How can I configure this pin specifically as a digital output?
Show LessI'm trying to interface my PSoC4 BLE to ADXL345.
I've set up the wiring as required, following sparkfun's hookup guide.
I'm using the following code to read registers
uint8 Accelerometer_RegRead(uint8 reg, uint8 *value)
{
uint8 ackStatus = COMM_FAIL;
ackStatus = I2C_I2CMasterSendStart(ACCELEROMETER_ADDR, ACC_WRITE);
UART_UartPutChar(ackStatus);
if(ackStatus == I2C_I2C_MSTR_NO_ERROR)
{
ackStatus = I2C_I2CMasterWriteByte(reg);
ackStatus = I2C_I2CMasterSendRestart(ACCELEROMETER_ADDR, ACC_READ);
*value = I2C_I2CMasterReadByte(I2C_I2C_NAK_DATA);
}
ackStatus = I2C_I2CMasterSendStop();
UART_UartPutChar(ackStatus);
return(ackStatus);
}
The first ackStatus gives 0x02 ie. I2C_I2C_MSTR_ERR_LB_NAK (Last Byte Naked) [No idea how to tackle this, any help appreciated]
and the second one gives 0x00 ie. no error
I tried this code instead too (Replacing the ones above)-
I2C_I2CMasterSendStart(ACCELEROMETER_ADDR, I2C_I2C_WRITE_XFER_MODE);
I2C_I2CMasterSendRestart(ACCELEROMETER_ADDR, I2C_I2C_READ_XFER_MODE);
Still the o/p was same as above
This happens in the cycle where I'm supposed to read the DevID register to verify integrity of data in device, so I can't say anything about the working of the Accelerometer itself.
How can I check that and is there anything I can do further
Regards,
Viraj
EDIT:- Spellings
Show LessDevice PSoC4 CYBLE-224116-01
Hello,
I am trying to create an application where the user can put the BLE device to sleep for certain hours.
I have created a service which has two characteristics; 1. Sleep time and 2. SleepNowFlag.
The user enters the duration for which it wants the BLE device to sleep, and they write on to the SleepNowFlag when they want to put the BLE to sleep.
The firmware in the BLE device keeps checking the flag; and when the flag is set it puts itself to sleep.
Now i want the device to wakeup when the sleep time is over and start advertising. I thought of using the RTC Alarm Feature but am not able to figure out how.
Please Help!
Show Less