winIDEA SDK: writeRegister() call not working

19-Feb-2024

When trying to write a value into a specific Special Function Register (SFR register) using the writeRegister() SDK function an error occurs,  stating that the specified register doesn't exist.


Possible solution: 

Method CDataController::writeRegister() can write to Core Registers only. For SFRs method CDataController::modify() should be used.

Example:

dataCtrl.modify(ic.IConnectDebug.fMonitor, '@TIM1\\CCR1', '12')


To get the full name of the SFR, which is required by the method:

  1. Drag and drop the SFR from the SFR Window into the Watch Window to get the exact strings needed for the script. 

  2. Copy the string from the Watch Window into your script:

  • Right-click on the row and select Copy Name or
  • Press keys CTRL + C.

     


    More resources:




      Was this answer helpful?