Skip to content

Commit 408eaff

Browse files
author
Microchip Technology
committed
updated to latest 4.1.0 firmware;fixing aws submodule maybe?;fixing data to be rc1;reverting print;update ignore;removing versioned copies of ftl generated files;fixing doc problems;updating revision;
1 parent 5aea48c commit 408eaff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1506
-918
lines changed

.main-meta/main.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"metaDataVersion": "1.0.0",
3+
"category": "com.microchip.ide.project",
4+
"content": {
5+
"metaDataVersion": "1.1.0",
6+
"name": "com.microchip.mplabx.project.pic-iot-aws-sensor-node",
7+
"version": "4.1.0",
8+
"displayName": "PIC-IoT AWS Sensor Node",
9+
"projectName": "pic-iot-aws-sensor-node",
10+
"shortDescription": "Microchip PIC-IoT WA (Wireless for Amazon Web Services) Application Example",
11+
"ide": {
12+
"name": "MPLABX",
13+
"semverRange": ">=5.40.0"
14+
},
15+
"compiler": [
16+
{
17+
"name": "xc16",
18+
"semverRange": "^1.41.0"
19+
}
20+
],
21+
"dfp": {
22+
"name": "PIC24F-GA-GB_DFP",
23+
"semverRange": "^1.0.67"
24+
},
25+
"device": {
26+
"metaDataVersion": "1.0.0",
27+
"category": "com.microchip.portal.contentRef",
28+
"content": {
29+
"metaDataVersion": "1.0.0",
30+
"category": "com.microchip.device",
31+
"name": "PIC24FJ128GA705",
32+
"versionRange": "*"
33+
}
34+
}
35+
}
36+
}

PICIoT.X/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525

2626
int main(void)
2727
{
28-
application_init();
28+
application_init();
2929

30-
while (1)
31-
{
32-
runScheduler();
33-
}
30+
while (1)
31+
{
32+
runScheduler();
33+
}
3434

35-
return 0;
35+
return 0;
3636
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
* THIS SOFTWARE.
2929
*/
3030

31-
#include <stdbool.h>
3231
#include "CryptoAuth_init.h"
3332

3433
struct atca_command _gmyCommand;
@@ -45,7 +44,6 @@ ATCAIfaceCfg secureCfg = {
4544
.rx_retries = 20
4645
};
4746

48-
4947
bool CryptoAuth_Initialize(void)
5048
{
5149
uint8_t calInitialzeStatus;
@@ -60,4 +58,3 @@ bool CryptoAuth_Initialize(void)
6058
return true;
6159
}
6260
}
63-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
* THIS SOFTWARE.
2929
*/
3030

31-
#include <stdbool.h>
3231
#include "cryptoauthlib_config.h"
3332
#include "CryptoAuthenticationLibrary/cryptoauthlib.h"
3433

PICIoT.X/mcc_generated_files/CryptoAuthenticationLibrary/atca_cfgs.c

Lines changed: 72 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -38,89 +38,106 @@
3838

3939
/** \brief default configuration for an ECCx08A device */
4040
ATCAIfaceCfg cfg_ateccx08a_i2c_default = {
41-
.iface_type = ATCA_I2C_IFACE,
42-
.devtype = ATECC508A,
43-
.atcai2c.slave_address = 0xC0,
44-
.atcai2c.bus = 2,
45-
.atcai2c.baud = 400000,
46-
//.atcai2c.baud = 100000,
47-
.wake_delay = 1500,
48-
.rx_retries = 20
41+
.iface_type = ATCA_I2C_IFACE,
42+
.devtype = ATECC608A,
43+
{
44+
.atcai2c.slave_address = 0xC0,
45+
.atcai2c.bus = 2,
46+
.atcai2c.baud = 400000,
47+
//.atcai2c.baud = 100000,
48+
},
49+
.wake_delay = 1500,
50+
.rx_retries = 20
4951
};
5052

5153
/** \brief default configuration for an ECCx08A device on the logical SWI bus over UART*/
5254
ATCAIfaceCfg cfg_ateccx08a_swi_default = {
53-
.iface_type = ATCA_SWI_IFACE,
54-
.devtype = ATECC508A,
55-
.atcaswi.bus = 4,
56-
.wake_delay = 1500,
57-
.rx_retries = 10
55+
.iface_type = ATCA_SWI_IFACE,
56+
.devtype = ATECC608A,
57+
{
58+
.atcaswi.bus = 4,
59+
},
60+
.wake_delay = 1500,
61+
.rx_retries = 10
5862
};
5963

6064
/** \brief default configuration for Kit protocol over the device's async interface */
6165
ATCAIfaceCfg cfg_ateccx08a_kitcdc_default = {
62-
.iface_type = ATCA_UART_IFACE,
63-
.devtype = ATECC508A,
64-
.atcauart.port = 0,
65-
.atcauart.baud = 115200,
66-
.atcauart.wordsize = 8,
67-
.atcauart.parity = 2,
68-
.atcauart.stopbits = 1,
69-
.rx_retries = 1,
66+
.iface_type = ATCA_UART_IFACE,
67+
.devtype = ATECC608A,
68+
{
69+
.atcauart.port = 0,
70+
.atcauart.baud = 115200,
71+
.atcauart.wordsize = 8,
72+
.atcauart.parity = 2,
73+
.atcauart.stopbits = 1,
74+
},
75+
.rx_retries = 1,
7076
};
7177

7278
/** \brief default configuration for Kit protocol over the device's async interface */
7379
ATCAIfaceCfg cfg_ateccx08a_kithid_default = {
74-
.iface_type = ATCA_HID_IFACE,
75-
.devtype = ATECC508A,
76-
.atcahid.idx = 0,
77-
.atcahid.vid = 0x03EB,
78-
.atcahid.pid = 0x2312,
79-
.atcahid.packetsize = 64,
80-
.atcahid.guid = { 0x4d, 0x1e, 0x55, 0xb2, 0xf1, 0x6f, 0x11, 0xcf, 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 },
80+
.iface_type = ATCA_HID_IFACE,
81+
.devtype = ATECC608A,
82+
{
83+
.atcahid.dev_interface = ATCA_KIT_AUTO_IFACE,
84+
.atcahid.dev_identity = 0,
85+
.atcahid.idx = 0,
86+
.atcahid.vid = 0x03EB,
87+
.atcahid.pid = 0x2312,
88+
.atcahid.packetsize = 64,
89+
}
8190
};
8291

92+
8393
/** \brief default configuration for a SHA204A device on the first logical I2C bus */
8494
ATCAIfaceCfg cfg_atsha204a_i2c_default = {
85-
.iface_type = ATCA_I2C_IFACE,
86-
.devtype = ATSHA204A,
87-
.atcai2c.slave_address = 0xC8,
88-
.atcai2c.bus = 2,
89-
.atcai2c.baud = 400000,
90-
.wake_delay = 2560,
91-
.rx_retries = 20
95+
.iface_type = ATCA_I2C_IFACE,
96+
.devtype = ATSHA204A,
97+
{
98+
.atcai2c.slave_address = 0xC8,
99+
.atcai2c.bus = 2,
100+
.atcai2c.baud = 400000,
101+
},
102+
.wake_delay = 2560,
103+
.rx_retries = 20
92104
};
93105

94106
/** \brief default configuration for an SHA204A device on the logical SWI bus over UART*/
95107
ATCAIfaceCfg cfg_atsha204a_swi_default = {
96-
.iface_type = ATCA_SWI_IFACE,
97-
.devtype = ATSHA204A,
98-
.atcaswi.bus = 4,
99-
.wake_delay = 2560,
100-
.rx_retries = 10
108+
.iface_type = ATCA_SWI_IFACE,
109+
.devtype = ATSHA204A,
110+
{
111+
.atcaswi.bus = 4,
112+
},
113+
.wake_delay = 2560,
114+
.rx_retries = 10
101115
};
102116

103117
/** \brief default configuration for Kit protocol over the device's async interface */
104118
ATCAIfaceCfg cfg_atsha204a_kitcdc_default = {
105-
.iface_type = ATCA_UART_IFACE,
106-
.devtype = ATSHA204A,
107-
.atcauart.port = 0,
108-
.atcauart.baud = 115200,
109-
.atcauart.wordsize = 8,
110-
.atcauart.parity = 2,
111-
.atcauart.stopbits = 1,
112-
.rx_retries = 1,
119+
.iface_type = ATCA_UART_IFACE,
120+
.devtype = ATSHA204A,
121+
{
122+
.atcauart.port = 0,
123+
.atcauart.baud = 115200,
124+
.atcauart.wordsize = 8,
125+
.atcauart.parity = 2,
126+
.atcauart.stopbits = 1,
127+
},
128+
.rx_retries = 1,
113129
};
114130

115131
/** \brief default configuration for Kit protocol over the device's async interface */
116132
ATCAIfaceCfg cfg_atsha204a_kithid_default = {
117-
.iface_type = ATCA_HID_IFACE,
118-
.devtype = ATSHA204A,
119-
.atcahid.idx = 0,
120-
.atcahid.vid = 0x03EB,
121-
.atcahid.pid = 0x2312,
122-
.atcahid.packetsize = 64,
123-
.atcahid.guid = { 0x4d, 0x1e, 0x55, 0xb2, 0xf1, 0x6f, 0x11, 0xcf, 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 },
133+
.iface_type = ATCA_HID_IFACE,
134+
.devtype = ATSHA204A,
135+
.atcahid.dev_interface = ATCA_KIT_AUTO_IFACE,
136+
.atcahid.dev_identity = 0,
137+
.atcahid.idx = 0,
138+
.atcahid.vid = 0x03EB,
139+
.atcahid.pid = 0x2312,
140+
.atcahid.packetsize = 64,
124141
};
125142

126143
/** @} */

PICIoT.X/mcc_generated_files/CryptoAuthenticationLibrary/atca_command.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ void atCalcCrc(ATCAPacket *packet)
648648
{
649649
uint8_t length, *crc;
650650

651+
packet->param2 = ATCA_UINT16_HOST_TO_LE(packet->param2);
652+
651653
length = packet->txsize - ATCA_CRC_SIZE;
652654
// computer pointer to CRC in the packet
653655
crc = &(packet->txsize) + length;

PICIoT.X/mcc_generated_files/CryptoAuthenticationLibrary/atca_command.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
#include "atca_compiler.h"
3838
#include "atca_status.h"
3939
#include "atca_devtypes.h"
40-
#include "cryptoauthlib_config.h"
40+
#include "../cryptoauthlib_config.h"
4141
#include <stddef.h>
4242

43+
4344
#ifdef __cplusplus
4445
extern "C" {
4546
#endif
@@ -85,14 +86,17 @@ void deleteATCACommand(ATCACommand *ca_cmd);
8586

8687
// Note: pack @ 2 is required, @ 1 causes word alignment crash (though it should not), a known bug in GCC.
8788
// @2, the wire still has the intended byte alignment with arm-eabi. this is likely the least portable part of atca
88-
#if defined(__XC16__)||defined(__XC32__)
89+
90+
91+
#ifdef ATCA_NO_PRAGMA_PACK
92+
typedef struct __attribute__ ((packed))
93+
#else
8994
#pragma pack( push, ATCAPacket, 2 )
95+
typedef struct
9096
#endif
91-
9297
/** \brief an ATCA packet structure. This is a superset of the packet transmitted on the wire. It's also
9398
* used as a buffer for receiving the response
9499
*/
95-
typedef struct
96100
{
97101

98102
// used for transmit/send
@@ -117,7 +121,7 @@ typedef struct
117121

118122
} ATCAPacket;
119123

120-
#if defined(__XC16__)||defined(__XC32__)
124+
#ifndef ATCA_NO_PRAGMA_PACK
121125
#pragma pack( pop, ATCAPacket)
122126
#endif
123127

@@ -344,6 +348,7 @@ ATCA_STATUS atCheckCrc(const uint8_t *response);
344348
#define COUNTER_MODE_READ ((uint8_t)0x00) //!< Counter command mode for reading
345349
#define COUNTER_MODE_INCREMENT ((uint8_t)0x01) //!< Counter command mode for incrementing
346350
#define COUNTER_RSP_SIZE ATCA_RSP_SIZE_4 //!< Counter command response packet size
351+
#define COUNTER_SIZE ATCA_RSP_SIZE_MIN //!< Counter size in binary
347352
/** @} */
348353

349354
/** \name Definitions for the DeriveKey Command

PICIoT.X/mcc_generated_files/CryptoAuthenticationLibrary/atca_compiler.h

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,62 @@
3131
#ifndef ATCA_COMPILER_H_
3232
#define ATCA_COMPILER_H_
3333

34-
#if defined(__clang__)
34+
#if defined(__clang__)&& defined(__AVR_ARCH__)
3535
/* Clang/LLVM. ---------------------------------------------- */
3636
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
37+
#define ATCA_UINT16_HOST_TO_LE(x) __builtin_bswap16(x)
38+
#define ATCA_UINT16_LE_TO_HOST(x) __builtin_bswap16(x)
39+
#define ATCA_UINT32_HOST_TO_LE(x) __builtin_bswap32(x)
3740
#define ATCA_UINT32_HOST_TO_BE(x) (x)
3841
#define ATCA_UINT32_BE_TO_HOST(x) (x)
3942
#define ATCA_UINT64_HOST_TO_BE(x) (x)
4043
#define ATCA_UINT64_BE_TO_HOST(x) (x)
4144
#else
45+
#define ATCA_UINT16_HOST_TO_LE(x) (x)
46+
#define ATCA_UINT16_LE_TO_HOST(x) (x)
47+
#define ATCA_UINT32_HOST_TO_LE(x) (x)
4248
#define ATCA_UINT32_HOST_TO_BE(x) __builtin_bswap32(x)
4349
#define ATCA_UINT32_BE_TO_HOST(x) __builtin_bswap32(x)
4450
#define ATCA_UINT64_HOST_TO_BE(x) __builtin_bswap64(x)
4551
#define ATCA_UINT64_BE_TO_HOST(x) __builtin_bswap64(x)
4652
#endif
4753

54+
#elif defined(__XC8) || defined(__XC16)
55+
/* Microchip XC8 and XC16 Compilers ------------------------- */
56+
#define ATCA_UINT16_HOST_TO_LE(x) (x)
57+
#define ATCA_UINT16_LE_TO_HOST(x) (x)
58+
#define ATCA_UINT32_HOST_TO_LE(x) (x)
59+
#define ATCA_UINT32_HOST_TO_BE(x) (((x & 0x000000FF)<<24) | ((x & 0x0000FF00)<<8) | ((x & 0x00FF0000)>>8) | ((x & 0xFF000000) >> 24))
60+
#define ATCA_UINT32_BE_TO_HOST(x) (((x & 0x000000FF)<<24) | ((x & 0x0000FF00)<<8) | ((x & 0x00FF0000)>>8) | ((x & 0xFF000000) >> 24))
61+
#define ATCA_UINT64_HOST_TO_BE(x) ((uint64_t)ATCA_UINT32_HOST_TO_BE((uint32_t)x)<<32 + (uint64_t)ATCA_UINT32_HOST_TO_BE((uint32_t)(x>>32)))
62+
#define ATCA_UINT64_BE_TO_HOST(x) ((uint64_t)ATCA_UINT32_BE_TO_HOST((uint32_t)x)<<32 + (uint64_t)ATCA_UINT32_BE_TO_HOST((uint32_t)(x>>32)))
63+
4864
#elif defined(__ICC) || defined(__INTEL_COMPILER)
4965
/* Intel ICC/ICPC. ------------------------------------------ */
5066

5167
#elif defined(__GNUC__) || defined(__GNUG__)
5268
/* GNU GCC/G++. --------------------------------------------- */
53-
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
69+
#if defined(__AVR32__)
70+
#define ATCA_UINT16_HOST_TO_LE(x) __builtin_bswap_16(x)
71+
#define ATCA_UINT16_LE_TO_HOST(x) __builtin_bswap_16(x)
72+
#define ATCA_UINT32_HOST_TO_LE(x) __builtin_bswap_32(x)
73+
#define ATCA_UINT32_HOST_TO_BE(x) (x)
74+
#define ATCA_UINT32_BE_TO_HOST(x) (x)
75+
#define ATCA_UINT64_HOST_TO_BE(x) (x)
76+
#define ATCA_UINT64_BE_TO_HOST(x) (x)
77+
#define ATCA_NO_PRAGMA_PACK
78+
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
79+
#define ATCA_UINT16_HOST_TO_LE(x) __builtin_bswap16(x)
80+
#define ATCA_UINT16_LE_TO_HOST(x) __builtin_bswap16(x)
81+
#define ATCA_UINT32_HOST_TO_LE(x) __builtin_bswap32(x)
5482
#define ATCA_UINT32_HOST_TO_BE(x) (x)
5583
#define ATCA_UINT32_BE_TO_HOST(x) (x)
5684
#define ATCA_UINT64_HOST_TO_BE(x) (x)
5785
#define ATCA_UINT64_BE_TO_HOST(x) (x)
5886
#else
87+
#define ATCA_UINT16_HOST_TO_LE(x) (x)
88+
#define ATCA_UINT16_LE_TO_HOST(x) (x)
89+
#define ATCA_UINT32_HOST_TO_LE(x) (x)
5990
#define ATCA_UINT32_HOST_TO_BE(x) __builtin_bswap32(x)
6091
#define ATCA_UINT32_BE_TO_HOST(x) __builtin_bswap32(x)
6192
#define ATCA_UINT64_HOST_TO_BE(x) __builtin_bswap64(x)
@@ -72,10 +103,14 @@
72103
/* Microsoft Visual Studio. --------------------------------- */
73104
// MSVC is usually always little-endian architecture
74105
#include <stdlib.h>
106+
#define ATCA_UINT16_HOST_TO_LE(x) (x)
107+
#define ATCA_UINT16_LE_TO_HOST(x) (x)
108+
#define ATCA_UINT32_HOST_TO_LE(x) (x)
75109
#define ATCA_UINT32_HOST_TO_BE(x) _byteswap_ulong(x)
76110
#define ATCA_UINT32_BE_TO_HOST(x) _byteswap_ulong(x)
77111
#define ATCA_UINT64_HOST_TO_BE(x) _byteswap_uint64(x)
78112
#define ATCA_UINT64_BE_TO_HOST(x) _byteswap_uint64(x)
113+
#define strtok_r strtok_s
79114

80115
#elif defined(__PGI)
81116
/* Portland Group PGCC/PGCPP. ------------------------------- */

0 commit comments

Comments
 (0)