Skip to content

Commit 30f0bc6

Browse files
committed
[PSOC6]: Fix for static resource manager.
1 parent 86915d9 commit 30f0bc6

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8C63XX/psoc6_static_srm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@
6464
// Reservations below apply to default M0 hex image.
6565

6666
// P0_0 and p0_1 reserved for WCO, P6-6 and P6_7 reserved for SWD
67-
#define M0_ASSIGNED_PORTS SRM_PORT(0, 0x03), SRM_PORT(6, 0xc0), SRM_PORT(11, 0x02)
68-
// 8-bit divider 0 reserved for us ticker.
69-
#define M0_ASSIGNED_DIVIDERS SRM_DIVIDER(CY_SYSCLK_DIV_8_BIT, 0x01), \
70-
SRM_DIVIDER(CY_SYSCLK_DIV_16_BIT, 0x01)
67+
#define M0_ASSIGNED_PORTS SRM_PORT(0, 0x03), SRM_PORT(6, 0xc0)
68+
// 8-bit divider 0 reserved for us ticker
69+
#define M0_ASSIGNED_DIVIDERS SRM_DIVIDER(CY_SYSCLK_DIV_8_BIT, 0x01)
7170
#define M0_ASSIGNED_SCBS
72-
#define M0_ASSIGNED_TCPWMS
71+
// TCPWM 0,0 used for us_ticker
72+
#define M0_ASSIGNED_TCPWMS SRM_TCPWM(0)
7373

7474
/* End of File */

targets/TARGET_Cypress/TARGET_PSOC6/psoc6_utils.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ do { \
101101

102102
#define DEFAULT_PORT_RES 0xff
103103
#define DEFAULT_DIVIDER_RES 0xffff
104+
#define DEFAULT_DIVIDER8_RES 0xffff
104105
#define DEFAULT_SCM_RES 1
105106
#define DEFAULT_TCPWM_RES 1
106107

@@ -438,6 +439,21 @@ void cy_get_bd_mac_address(uint8_t *buffer)
438439

439440
void cy_srm_initialize(void)
440441
{
442+
#if defined(TARGET_MCU_PSOC6_M0) || PSOC6_DYNSRM_DISABLE || !defined(__MBED__)
443+
uint32_t i;
444+
445+
for (i = 0; i < CY_NUM_PSOC6_PORTS; ++i) {
446+
port_reservations[i] = DEFAULT_PORT_RES;
447+
}
448+
449+
for (i = 0; i < NUM_SCB; ++i) {
450+
scb_reservations[i] = DEFAULT_SCM_RES;
451+
}
452+
453+
for (i = 0; i < NUM_TCPWM; ++i) {
454+
tcpwm_reservations[i] = DEFAULT_TCPWM_RES;
455+
}
456+
441457
#if PSOC6_DYNSRM_DISABLE
442458
#ifdef M0_ASSIGNED_PORTS
443459
SRM_INIT_RESOURCE(uint8_t, port_reservations,, M0_ASSIGNED_PORTS);
@@ -452,5 +468,6 @@ void cy_srm_initialize(void)
452468
SRM_INIT_RESOURCE(uint8_t, tcpwm_reservations,, M0_ASSIGNED_TCPWMS);
453469
#endif
454470
#endif // PSOC6_DYNSRM_DISABLE
471+
#endif // defined(TARGET_MCU_PSOC6_M0) || PSOC6_DSRM_DISABLE || !defined(__MBED__)
455472
}
456473

0 commit comments

Comments
 (0)