Which version of the BLE component are you using? There was a change in V2.0 that seems to fix that (look at the changes section in the DS).
The BLE component is the newest version v2.3.
I think that is not the issue like you mentioned because the PROC can do the callback() sometimes by the event "CYBLE_EVT_GATTS_PREP_WRITE_REQ", the behavior is different than old version.
How do I know the size of queue current used and how to expand it to queue more bytes of data?
I don't know about the queue size. I just stumbled because of another forum question about the change list in the BLE data sheet, thats why I thought it might be worth a look.
Maybe you should create a support case ('MyCases' on the dro-down in the upper right), in my experience the support is quite fast. It would be nice if you then come back with the solution (if any).
Got the answer from Technical Support.
On Server side, it can only queue 10 prepare write requests, the number of bytes per request depends on the negotiated MTU.
So I changed the MTU size to 517 (5 bytes for header), now it can successfully transmit 512 bytes by the "write long" command.
Just for reference,
in my application, the buffer type and length of Characteristic of Profiles have to configure to "uint8 array" and "512".
Thanks for the feedback!