PSoC™ 4 Forum Discussions
text.format{('custom.tabs.no.results')}
Hello,
I want to change the device name dynamically, it's working correctly when the device is powered.
But after the reset, the content of data in flash is the inizialisation value of the constant & with the value stored in flash
I declare a constant with initialisation value (is it not supposed to be initialised only once ?)
const char8 deviceNameInFlash[20] = {'D','e','f','a','u','l','t')};
----------------------------
In the stack :
case CYBLE_EVT_STACK_ON: /* This event is received when component is Started */
CyBle_GapSetLocalName(deviceNameInFlash);
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
break;
---------------------------
if(CYBLE_SHUTBASSCV_DEVICENAME_CHAR_HANDLE == wrReqParam->handleValPair.attrHandle)
{
for(i=0;i<wrReqParam->handleValPair.value.len;i++)
{/*Client has to write the ASCI values of the characters that are in the name*/
tempName=wrReqParam->handleValPair.value.val;
}
StoreInFlash(tempName, wrReqParam->handleValPair.value.len);
communHandle.attrHandle = CYBLE_SHUTBASSCV_DEVICENAME_CHAR_HANDLE;
communHandle.value.val = (uint8*) tempName;
communHandle.value.len = wrReqParam->handleValPair.value.len;
CyBle_GattsWriteAttributeValue(&communHandle,FALSE,&connectionHandle,FALSE);
}
void StoreInFlash( char8 *newData, uint8 length)
{
CYBLE_API_RESULT_T result;
CyBle_ExitLPM();
do
{
result = CyBle_StoreAppData((uint8*)newData, (uint8*)&deviceNameInFlash,length,0);
}
while (result!=CYBLE_ERROR_OK);
CyBle_GapSetLocalName((const char *)newData);
}
If the user replace the name by "test" , when disconnect/reconnect we have 'test'
But after device reset we have : "testult"
So the data in flash is reseted, and i don't understand why, "const " is not supposed to mean initialized once ?
Thanks for your answers.
Show LessHello,
I am creating a dmx transmitter. Iam creating a break on a pin with the XXX_Write(Bolean); command and it works find. After the break it goes high to a MAB and i want to swith the output from digital write with a command to the UART so the UART can send the DMX data.
While writing the digital pin high and low with the Hardware Connection connected to the pin it goes low but in a curve. When turning the pin on and off it should become a square but the falling edge isn't straight down.
How can i do this?
I was thinking of turning on and off the Hardware Connection of my pin when iam commanding the break and turning it on when the UART is going to send data, but i can't find a register or something that can turn it on and off mid program. (short said connect and disconnect it from the UART block)
Thank you!
ps: i have the CyCKIT-044 PSoC 4 M-series pioneer kit with a PSoC 4200M device
Show LessIs this possible? We are hoping to change between PLL1 which is ECO trimmed to Direct_Sel or something else that can be sourced from IMO and USB trimmed. The reason why is that when power is disconnected from the host Laptop, the communication timing appears to change a little bit, and when the clock is trimmed by the host it seems to handle it better. I am hoping to change the clock source whenever VBus is detected but return to normal when it is disconnected to keep good timing on a CAN bus also connected to the micro.
Show LessI have:
Read all available posts on this error.
Checked to see that my uart buffer is 64 bytes.
Updated all components (using psoc 4.1)
Triple checked the dependencies in the bootloadable object to verify hex and elf point to the bootloader's hex and elf files.
Cleaned and rebuilt and reloaded the bootloader.
Running the bootloader host that came with 4.1.
Bootloader and bootloadable projects are in the same workspace.
Still get this error message.
Show LessAll;
I am trying to figure out how to create a Dual-application Bootloader that allows my application code to get a new image from our server and store it in the 'other' image area on my CPU's flash then once verified by my application, jump to the bootloader to then switch to the new image. Then, the next time I get new code, I write it to the 'other' image area (that I was running out of before the last update) and once again, jump to the booloader and run the new image. Basically flipping back and forth when new code arrives. Do I have the correct idea here? If so, are there any examples of how to setup up the project(s) to do this? I am using a CY8C4248AZI-L475 as my CPU. My code size is <20k so there is plenty of flash to store 2 copies.
One other note is my application is basically done and runs on its own. Can you easily make a standard project into a bootloader-bootloadable one?
Hope somebody can steer me in the right direction. Thanks, in advance.
Show LessI want the ble module to execute some functions upon one of it's characteristics being read. Here is my callback function code:
void BleCallBack( uint32 event, void* eventParam )
{
CYBLE_GATTS_READ_RSP_PARAM_T *rdRspParam;
switch( event )
{
case CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ:
rdRspParam = ( CYBLE_GATTS_READ_RSP_PARAM_T * ) eventParam;
if( rdRspParam->?????.attrHandle == CYBLE_DIAPER_BUCKLE_STOREDDIAPERCOUNT_CHAR_HANDLE; )
{
//code to run upon characteristic being read
}
break;
default:
break;
}
What should I use in place of the ?????s? Or should I be doing something completely different.
Thanks!
Show LessThanks for your help.
We do need to power a device with 5V 20mA using a BLE module (014008). The TRM mentions that maximum output current per pin is 20mA but when setting a pin that option is not available - maximum is 10mA
So we are implementing pin-ganging but it gets a bit 'mistycal' because when ganging pins and setting Output current to 10mA (as above) I will get a builder error - need to leave the minimum setup that is 8mA and it builds OK - but that it will cost 3 pins (3 * 8mA = 24mA) to get the minimum 20mA - questions:
- what is the best way to get 20mA sink current in an Output pin(s)?
- Why there is no option for 20mA sink current?
- How can I be sure that in the long run (production) that will not damage the PSoC (heating/etc)
Guidance will be appreciated
Thanks
Joe Rosa
Show LessGreetings!
I appreciate that PSoC Creator and newer versions of PSoC offer great improvements over Designer and PSoC 1 in many ways including the wide selection of easily configurable components. I understand that the newer versions of PSoC including PSoC 4 are preferable to PSoC 1 in most cases. However, I have a project that requires the simple Switched-Capacitor (SC) building blocks that can be configured at the switch level as are available in PSoC 1 and I cannot find anything like them in PSoC 4. Specifically, I'm looking for the equivalent of the SCBLOCK and SwitchCapConfig. Are there any equivalent components in PSoC 4 etc.. ? I'm new to PSoC and hope to choose the appropriate product family before I get deeper on the learning curve.
Please advise. Cheers! -Matt
Show Less