When I was busy with answering this question I found an inconsistency which will be solved next release. I will build a quick test version for you. I PM you a link.
int readDap(uint16_t ap, uint16_t addr); // The value is in InterfAPI.value32, return value is result which is also available at InterfAPI.result.
int writeDap(uint16_t ap, uint16_t addr, uint32_t value ); // Return value is InterfAPI.result
Remark: result is not theĀ actual answer but the response code (error) of the action.
I copied these functionality from openOCD for the stlink but I never used or tested it yet.
BTW
What would you think of starting an open stlink firmware project? If we have an USB-API compatible firmware we could add special commands and also flash it in the STlink V3 to make this also workable for other vendors.
int readDap(uint16_t ap, uint16_t addr); // The value is in InterfAPI.value32, return value is result which is also available at InterfAPI.result.
int writeDap(uint16_t ap, uint16_t addr, uint32_t value ); // Return value is InterfAPI.result
Remark: result is not theĀ actual answer but the response code (error) of the action.
I copied these functionality from openOCD for the stlink but I never used or tested it yet.
BTW
What would you think of starting an open stlink firmware project? If we have an USB-API compatible firmware we could add special commands and also flash it in the STlink V3 to make this also workable for other vendors.