Skip to content

Commit 1f329d0

Browse files
author
Cruz Monrreal
authored
Merge pull request #9009 from lrusinowicz/srm_fixes
[PSOC6]: Fix for static resource manager.
2 parents 0e3d712 + 30f0bc6 commit 1f329d0

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
@@ -102,6 +102,7 @@ do { \
102102
#define DEFAULT_PORT_RES 0xff
103103
#define DEFAULT_DIVIDER8_RES 0xff
104104
#define DEFAULT_DIVIDER_RES 0xffff
105+
#define DEFAULT_DIVIDER8_RES 0xffff
105106
#define DEFAULT_SCM_RES 1
106107
#define DEFAULT_TCPWM_RES 1
107108

@@ -439,6 +440,21 @@ void cy_get_bd_mac_address(uint8_t *buffer)
439440

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

0 commit comments

Comments
 (0)