OCD messaging over UPDI for ATtiny

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am trying to get messaging over UPDI for the ATTiny817 to work as explained in Microchip's user guide:

 

https://onlinedocs.microchip.com...

 

The sample code is quite short and simple, starting with two defines:

#define SYSCFG_OCDM SYSCFG.reserved_0x18
#define SYSCFG_OCDMS SYSCFG.reserved_0x19

 

The above code results in a compiler error complaining about undefined registers:

'SYSCFG_t {aka struct SYSCFG_struct}' has no member named 'reserved_0x18' (same for SYSCFG.reserved_0x19)

 

apparently the "reserved registers" are not defined in iotn817.h

 

Question 1: Assuming that the sample code has been used/tested by Microchip, which files do I have to include?

 

Question 2: Or how should I include a working definition without making changes to the supplied  iotn817.h, assuming that the registers reside at offset 0x18 and 0x19?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like the SYSCFG struct has changed:

--------------------------------------------------------------------------
SYSCFG - System Configuration Registers
--------------------------------------------------------------------------
*/

/* System Configuration Registers */
typedef struct SYSCFG_struct
{
    register8_t reserved_1[1];
    register8_t REVID;  /* Revision ID */
    register8_t EXTBRK;  /* External Break */
    register8_t reserved_2[29];
} SYSCFG_t;

So the OCDM would be in SYSCFG.reserved_2[0x18-3], and OCDMS at SYSCFG.reserved_2[0x19-3]

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thank you, seems to be the easiest solution. It turned out that in an old version (1.3.229 from 2018) of the Atmel device header file the reserved registers were defined as such.