Skip to content

Commit 71ffe89

Browse files
authored
Merge pull request #1927 from mbedmicro/tools-update3
Minor update to tools - logging of tests and output
2 parents 9433b4b + dcff9b1 commit 71ffe89

File tree

9 files changed

+86
-9
lines changed

9 files changed

+86
-9
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Silicon Labs:
9595
* [EFM32 Leopard Gecko](https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/) (Cortex-M3)
9696
* [EFM32 Giant Gecko](https://developer.mbed.org/platforms/EFM32-Giant-Gecko/) (Cortex-M3)
9797
* [EFM32 Wonder Gecko](https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/) (Cortex-M4)
98+
* [EFM32 Pearl Gecko](https://developer.mbed.org/platforms/EFM32-Pearl-Gecko/) (Cortex-M4)
9899

99100
Atmel:
100101
* [SAM R21 XPRO](https://developer.mbed.org/platforms/SAMR21-XPRO/) (Cortex-M0+)

hal/common/critical.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
18+
#define __STDC_LIMIT_MACROS
1919
#include <stdint.h>
2020
#include <stddef.h>
2121
#include "cmsis.h"

hal/common/error.c

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "device.h"
1919
#include "toolchain.h"
2020
#include "mbed_error.h"
21+
#include "mbed_interface.h"
2122
#if DEVICE_STDIO_MESSAGES
2223
#include <stdio.h>
2324
#endif

hal/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/system_MBRZA1H.c

+36
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,15 @@ void FPUEnable(void);
4949

5050
#endif
5151

52+
#define FRQCR_IFC_MSK (0x0030)
53+
#define FRQCR_IFC_SHFT (8)
54+
#define FRQCR_IFC_1P1 (0) /* x1/1 */
55+
#define FRQCR_IFC_2P3 (1) /* x2/3 */
56+
#define FRQCR_IFC_1P3 (3) /* x1/3 */
57+
5258
uint32_t IRQNestLevel;
5359
unsigned char seen_id0_active = 0; // single byte to hold a flag used in the workaround for GIC errata 733075
60+
uint32_t SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK; /*!< System Clock Frequency (Core Clock) */
5461

5562

5663
/**
@@ -198,6 +205,35 @@ uint32_t InterruptHandlerUnregister (IRQn_Type irq)
198205
}
199206
}
200207

208+
/**
209+
* Update SystemCoreClock variable
210+
*
211+
* @param none
212+
* @return none
213+
*
214+
* @brief Updates the SystemCoreClock with current core Clock.
215+
*/
216+
void SystemCoreClockUpdate (void)
217+
{
218+
uint32_t frqcr_ifc = ((uint32_t)CPG.FRQCR & (uint32_t)FRQCR_IFC_MSK) >> FRQCR_IFC_SHFT;
219+
220+
switch (frqcr_ifc) {
221+
case FRQCR_IFC_1P1:
222+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK;
223+
break;
224+
case FRQCR_IFC_2P3:
225+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK * 2 / 3;
226+
break;
227+
case FRQCR_IFC_1P3:
228+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK / 3;
229+
break;
230+
default:
231+
/* do nothing */
232+
break;
233+
}
234+
}
235+
236+
201237
/**
202238
* Initialize the system
203239
*

hal/targets/cmsis/TARGET_RENESAS/TARGET_RZ_A1H/system_MBRZA1H.h

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
extern "C" {
4444
#endif
4545

46+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
47+
4648
typedef void(*IRQHandler)();
4749
uint32_t InterruptHandlerRegister(IRQn_Type, IRQHandler);
4850
uint32_t InterruptHandlerUnregister(IRQn_Type);

hal/targets/cmsis/TARGET_RENESAS/TARGET_VK_RZ_A1H/system_VKRZA1H.c

+36
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,15 @@ void FPUEnable(void);
4949

5050
#endif
5151

52+
#define FRQCR_IFC_MSK (0x0030)
53+
#define FRQCR_IFC_SHFT (8)
54+
#define FRQCR_IFC_1P1 (0) /* x1/1 */
55+
#define FRQCR_IFC_2P3 (1) /* x2/3 */
56+
#define FRQCR_IFC_1P3 (3) /* x1/3 */
57+
5258
uint32_t IRQNestLevel;
5359
unsigned char seen_id0_active = 0; // single byte to hold a flag used in the workaround for GIC errata 733075
60+
uint32_t SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK; /*!< System Clock Frequency (Core Clock) */
5461

5562

5663
/**
@@ -198,6 +205,35 @@ uint32_t InterruptHandlerUnregister (IRQn_Type irq)
198205
}
199206
}
200207

208+
/**
209+
* Update SystemCoreClock variable
210+
*
211+
* @param none
212+
* @return none
213+
*
214+
* @brief Updates the SystemCoreClock with current core Clock.
215+
*/
216+
void SystemCoreClockUpdate (void)
217+
{
218+
uint32_t frqcr_ifc = ((uint32_t)CPG.FRQCR & (uint32_t)FRQCR_IFC_MSK) >> FRQCR_IFC_SHFT;
219+
220+
switch (frqcr_ifc) {
221+
case FRQCR_IFC_1P1:
222+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK;
223+
break;
224+
case FRQCR_IFC_2P3:
225+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK * 2 / 3;
226+
break;
227+
case FRQCR_IFC_1P3:
228+
SystemCoreClock = CM0_RENESAS_RZ_A1_I_CLK / 3;
229+
break;
230+
default:
231+
/* do nothing */
232+
break;
233+
}
234+
}
235+
236+
201237
/**
202238
* Initialize the system
203239
*

hal/targets/cmsis/TARGET_RENESAS/TARGET_VK_RZ_A1H/system_VKRZA1H.h

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
extern "C" {
4444
#endif
4545

46+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
47+
4648
typedef void(*IRQHandler)();
4749
uint32_t InterruptHandlerRegister(IRQn_Type, IRQHandler);
4850
uint32_t InterruptHandlerUnregister(IRQn_Type);

tools/build_api.py

-2
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@ def build_library(src_paths, build_path, target, toolchain_name,
383383
if toolchain_output:
384384
cur_result["output"] += toolchain_output
385385

386-
cur_result["output"] += str(e)
387-
388386
add_result_to_report(report, cur_result)
389387

390388
# Let Exception propagate

tools/toolchains/__init__.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
241241

242242
self.mp_pool = None
243243

244-
if 'UVISOR_PRESENT=1' in self.macros:
244+
if 'UVISOR' in self.target.features and 'UVISOR_SUPPORTED' in self.target.extra_labels:
245245
self.target.core = re.sub(r"F$", '', self.target.core)
246+
246247
self.flags = deepcopy(self.DEFAULT_FLAGS)
247248

248249
def get_output(self):
@@ -253,9 +254,12 @@ def print_notify(self, event, silent=False):
253254
"""
254255
msg = None
255256

256-
if event['type'] in ['info', 'debug']:
257+
if not self.VERBOSE and event['type'] == 'tool_error':
257258
msg = event['message']
258-
259+
260+
elif event['type'] in ['info', 'debug']:
261+
msg = event['message']
262+
259263
elif event['type'] == 'cc':
260264
event['severity'] = event['severity'].title()
261265
event['file'] = basename(event['file'])
@@ -775,9 +779,6 @@ def link_program(self, r, tmp_path, name):
775779
def default_cmd(self, command):
776780
self.debug("Command: %s"% ' '.join(command))
777781
_stdout, _stderr, _rc = run_cmd(command)
778-
# Print all warning / erros from stderr to console output
779-
for error_line in _stderr.splitlines():
780-
print error_line
781782

782783
self.debug("Return: %s"% _rc)
783784

0 commit comments

Comments
 (0)