Commit Graph

69 Commits (2aa2b7eb002812d23bdcb8b3fe619eacbd21a737)

Author SHA1 Message Date
TomoYamanaka 36ad12c403 Modify RAM size definition of ARMCC for GR-LYCHEE
I modified RAM size of ARMCC compiler for GR-LYCHEE.
In case of GR-LYCHEE, RAM size is 3M Byte(including Non-Cache area), but there was a typo at MACRO definition.
2018-06-25 15:44:01 +09:00
TomoYamanaka 94c13c5362 Support Bootloader for GR-PEACH and GR-LYCHEE
The mainly changes is below:
- Update scatter file, linker file for bootloader support
- Update the file for RZ/A1 serial flash boot loader
- Add "device name" and "bootloader_supported" in targets.json
2018-06-22 10:40:45 +09:00
TomoYamanaka 18a8eac72b Support Flash iAP for GR-PEACH and GR-LYCHEE
The mainly changes is below:
- Add flash_api.c
- Add the definition of SPI multi I/O Bus controller that is used for flash access
- Add "FLASH" as device feature
- Add the macro regarding information of the incorporated Flash
- Add the processing to expand code to RAM
2018-06-22 10:40:45 +09:00
Michael Coulter 3d3e89097d Fixes for RZ_A1H issue 6543
Removed debugging code, fixed errors indicated in the comments.
2018-06-11 13:30:17 -05:00
Cruz Monrreal 231f4cf9c1
Merge pull request #7034 from TomoYamanaka/master
Fix redeclaration of type name "bool_t" for Renesas
2018-05-29 10:44:29 -05:00
TomoYamanaka f34857792a Fix redeclaration of type name "bool_t"
I fixed redeclaration of type name "bool_t" for target Renesas because this typedef has been defined in rtx_core_ca.h by #6273.
2018-05-28 18:55:13 +09:00
TomoYamanaka f55becef9a Implement of RTC feature for Renesas mbed boards
I implemented the RTC feature.
The mainly changing is here.
- rtc_init()
  Previously, I have initialized the time information register in the function, so the time count was cleaned by every calling rtc_init().
  Currently, rtc_init() doesn't stop RTC from counting, and rtc_init() is safe to call repeatedly.
  Therefore in order to satisfy specifications,I removed the initialization process of the time information register in the function.

- rtc_free()
  Previously, I have initialized the RTC related register same as rtc_init(), so the time count was cleaned by calling rtc_free().
  Currently, rtc_free() doesn't stop RTC from counting.
  Therefore in order to satisfy specifications,I removed the process and decided not to do anything in the function.
  If powerdown the RTC, Supply of the clock to the RTC is stopped, cannot keeping the count.
2018-05-25 12:53:06 -05:00
TomoYamanaka b528fbdfb3 Implementation of USTICKER feature for Renesas mbed boards
I implemented USTICKER feature.

The mainly changing is here.
- I added a macro to mbed_drv_cfg.h for commonalizing code for GR-PEACH and GR-LYCHEE with different clock frequencies, and referenced it's macro at us_ticker.c.
- ticker_init()
  Currently, ticker_init() keep counting, disables the ticker interrupt, and is safe to call repeatedly.
  Therefore, in order to satisfy specifications, I removed GIC_EnableIRQ at end of function and added GIC_DisableIRQ at begin of function.
  When an interrupt is required, it will be set with ticker_set_interrupt().
  If executing the following, the counter has been initialized. So it will not call after executing the first time.
    OSTM1TT   = 0x01;    /* Stop the counter and clears the OSTM1TE bit.     */
    OSTM1TS   = 0x1;    /* Start the counter and sets the OSTM0TE bit.     */

- ticker_free()
  this function stops the counting and powerdown the us_ticker.
  To satisfy the mbed specificationm, I implemented free() function.

- ticker_read()
  Currently, Mbed spec's frequeny is between 250KHz and 8MHz, but the frequency that is used at my ticker is 33MHz.
  Therefore, in order to satisfy specifications, I changed the process to return the timer counter value divided by 32(33MHz / 32).
  Since the calcurate function by using 64 bit is no longer necessay, I removed it.

- ticker_set_interrupt()
  Same as the above read(),
  In order to satisfy specifications, I changed the process to set the value multiplied by 32.

- ticker_fire_interrupt()
  In order to satisfy specifications, I implemented fire_interrupt() function.
  Also I added GIC_EnableIRQ for allowing the interrupt at end of function.

- ticker_get_info()
  To satisfy the mbed specificationm, I implemented ticker_get_info() function. The value of freq includes rounding off.
2018-05-25 12:22:06 -05:00
TomoYamanaka 7a48ee89e3 Implementation of SLEEP feature for Renesas mbed boards
I implemented the SLEEP feature for Rnesas mbed boards.
The mainly changing is here.
- hal_sleep()
  To satisfy the mbed specificationm, I implemented this function newly by using "sleep" that is one of low power mode that is incorporated in our hardware(RZ_A1).
  In the "sleep", peripheral and memory state are maintained, and the peripherals continue to work and can generate interrupts.

- hal_deepsleep()
  To satisfy the mbed specificationm, I implemented this function newly by combined using "sleep" and "module standby" that is the low power mode that is incorporated in our hardware(RZ_A1).
  The "module standby" is peripheral module's powerdown.
  Also in case of our "module standby", it need to read register as dummy when access to each register.
2018-05-25 12:04:32 -05:00
Kevin Bracey 13dcef63e3
Merge pull request #6847 from ARMmbed/feature-emac
Merge feature-emac branch into master
2018-05-24 16:47:04 +03:00
TomoYamanaka bad530ab0d Implementation of unified EMAC driver for Renesas mbed boards
Implementation of unified EMAC driver for Renesas mbed boards

Based on the driver so far, Renesas implemented the emac driver for GR-PEACH and VK-RZ/A1H.
The mainly changes is below.
- Add the connection part with LWIP according to the unified emac specification.
- Add three new multicast functions(add, remove, set_all).

The Greentea test netsocket and emac test passed.
2018-05-23 12:24:09 +03:00
Bartek Szatkowski 42b48821eb Fix platform failing to build after rebase 2018-05-14 12:18:21 +01:00
Cruz Monrreal 2c7f909eea
Merge pull request #6245 from mbedNoobNinja/Sync_PR
Update for VK_RZ_A1H
2018-03-20 15:21:01 -05:00
mbedNoobNinja cf8fd20f9b Enabled os5 support for VK_RZ_A1H & synced with rest Renesas targets !
Mbed-os 5.4.7 was the last unofficial working support for this target.
Since Mbed-os 5.6.0, the support is now official and VK_RZ_A1H is now "codebase aligned" with GR_PEACH (RZ_A1H) & GR_LYCHEE (RZ_A1LU) !
2018-03-20 11:49:03 +02:00
TomoYamanaka 3183d21ba7 Fix macro definition of iodefine_typedef for RZ_A1H
Regarding RZ_A1H, Since I removed the macro definition accidentally in iodefine_typedef, I fixed the lack of it.
2018-03-07 20:33:11 +09:00
TomoYamanaka f6c6e79145 Fix NVIC Wrapper include
Renesas mbed boards incorporate NVIC Wrapper because Cortex-A9 use GIC. For example, NVIC_SystemReset() is defined in nvic_wrapper.c and declared in nvic_wrapper.h.
Because I removed one of include processing accidentally, I fixed the lack.
This supplements PR #5890.
2018-02-09 11:53:43 +09:00
TomoYamanaka 412a79d444 [RZ_A1LU] Fix TRNG function
Related to the review of #5857, I fixed the TRNG function for GR-LYCHEE.
- I modified to zeroize "recv_data" before the function return.
- I added the processing that check the return value of I2C.read function. If return value is error, "output" is zeroized before function return.
- In trng_get_bytes_esp32 function, there is a time lag in the period from ESP32 reset to start working, error may occur when "Write" is called. Thus, I added a retry counter due to address this concern. There is not this counter for "Read" since it is called after "Write".
2018-02-06 15:44:33 +09:00
Cruz Monrreal da6532e57a
Merge pull request #5857 from TomoYamanaka/master
Registration GR-LYCHEE board as a new mbed board
2018-01-26 10:50:44 -06:00
TomoYamanaka 1469fcde41 RZ_A1LU: cmsis nvic include fix
To get cmsis nvic definitions, I added the process that include "cmsis_nvic.h" in cmsis.h.
Relation PR is #5890.
2018-01-20 00:29:09 +09:00
Martin Kojtal 5554ab28b3 RZ_A1H: cmsis nvic include fix
To get cmsis nvic definitions, this header file should be included
in cmsis.h file.

Fixes #5886
2018-01-19 13:49:25 +00:00
TomoYamanaka e8378effc8 Modify the arrangement of "{" that shows the function start
Regarding "{" that show the function start, I modified the the arrangement from right of function to new line.
2018-01-19 18:46:20 +09:00
TomoYamanaka 4bc79b0ecf Add license header on top in reserved_pins.h
I modified the lack of license header in the below header files.
- targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/TARGET_MBED_MBRZA1H/reserved_pins.h
- targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/TARGET_MBED_MBRZA1LU/reserved_pins.h
2018-01-19 18:39:37 +09:00
TomoYamanaka ae1eaa985f Support TRNG function for GR-LYCHEE
I supported the TRNG function when target is GR-LYCHEE.
GR-LYCHEE generates TRNG by acquiring the random number of Wifi module(ESP32) incorporated in it using I2C.
2018-01-16 13:45:15 +09:00
TomoYamanaka aa5da2cd2e Add the definition for GR-LYCHEE in mbed_rtx.h
In mbed_rtx.h file, I added the definition for GR-LYCHEE to use the "Dynamic Heap" processing when the target is GR_LYCHEE.
2018-01-16 13:39:44 +09:00
TomoYamanaka 776b27cefb Add startup processing having CMSIS5/RTX5 been available on GR-LYCHEE
For supporting to CMSIS5/RTX5, I added the start-up processing of 3 toolchains (ARMCC, GCC_ARM, IAR) and the register definition of RZ/A1LU specific.
In addition, I added the linker script files to implement the dynamic HEAP the same as GR-PEACH(RZ/A1H).
2018-01-16 13:34:35 +09:00
TomoYamanaka b92f75ad3c Modify the lack of copyright to header files
I modified the lack of copyright in the below header files that I added for commonizing the RZ_A1 related files.
- targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/mbed_drv_cfg.h
- targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_VK_RZ_A1H/mbed_drv_cfg.h
2018-01-12 14:18:54 +09:00
TomoYamanaka 8b7e2abdb7 Commonalize the files in "targets/TARGET_RENESAS/TARGET_RZ_A1XX" directory
I made be available in common whatever the board related to RZ_A1 in the below files.
- Since there are the table code of Pinmap differs for each board, I moved the code to "PeripheralPins" file for each board, and changed to include PeripheralPins.h.
  analogin_api.c, can_api.c, gpio_irq_api.c, i2c_api.c, pinmap.c, port_api.c, pwmout_api.c, serial_api.c, spi_api.c and us_ticker.c

- Since there are some board-specific processes, I enclosed the processes with "#ifdef" and rearranged the functions to make be easier to enclose.
  can_api.c, ethernet_api.c and serial_api.c

- Since there are the driver configuration values differs for each board, I added "mbed_drv_cfg.h" file for each board and defined macros for the values, and changed to refer to the macros.
  can_api.c, gpio_api.c, pwmout_api.c and rtc_api.c
2018-01-09 18:20:50 +09:00
TomoYamanaka 6f851a820c Revise the folder structure in "targets/TARGET_RENESAS" directory
In "targets/TARGET_RENESAS" folders, same as Cortex-M targets, I changed the folder structure to combine files that can be shared as RZ/A1 related.
 And I renamed the folder name to "TARGET_RZ_A1XX" in order to make commonality explicit.
- "targets/TARGET_RENESAS" folder
  <before>
  \targets\TARGET_RENESAS\TARGET_RZ_A1H
  \targets\TARGET_RENESAS\TARGET_VK_RZ_A1H
  <after>
  \targets\TARGET_RENESAS\TARGET_RZ_A1XX
2018-01-09 17:39:22 +09:00
Martin Kojtal fed5dd1170 VK RZ A1H: fix errors from the latest cmsis updates
Use mbed critical section
2018-01-02 11:48:56 +00:00
Martin Kojtal 3247a96588 renesas: os tick only for rtos
As this is os tick implementation for rtos, it should not be compilied if rtos
not present (mbed 2)
2017-12-31 17:21:02 +01:00
TomoYamanaka 1bb2ca68ea Supplement the lack of "extended RTC" in RZ_A1H/rtc_api.c
Although the extened RTC is supported by #5363 commit ("Add support and tests for extended RTC"), it seems that the changes was overlooked in RZ_A1H_api.c.
So I added the changes with reference to other rtc_api.c.
2017-12-21 14:09:24 +09:00
TomoYamanaka f526f19661 Change the way of enter/exit of critical section of code
I changed disable_irq() / enable_irq() to core_util_critical_section_enter() / core_util_critical_section_exit() by utilizing "mbed_critical" function in the below drivers.
- serial_api.c
- us_ticker.c
2017-12-21 14:09:24 +09:00
TomoYamanaka 904fdaea7a Add the lacked definitions to mbed_rtx.h
I added the below definitions for working "Dynamic Stack" and "Dynamic heap" on Mbed OS by referencing with the codes of Cortex-M target board.
"ISR_STACK_START", "ISR_STACK_SIZE", "INITIAL_SP", "HEAP_START" and "HEAP_SIZE"
2017-12-21 14:09:24 +09:00
TomoYamanaka 2d11d6ef77 Add GIC_SetConfigration function to satisfy Cortex-A interrupt spec
By updating to the codes of CMSIS5/RTX5, GIC_SetConfigration() function was added for Cortex-A, this function is set the interrupt configuration using GIC's ICFGR register. Therefore, I added this function to satisfy Cortex-A interrupt spec in the below files.
"can_api.c", "ethernet_api.c", "gpio_irq_api.c", "i2c_api.c", "spi_api.c" and "us_ticker.c"
2017-12-21 14:09:24 +09:00
TomoYamanaka 15e91c1579 Revise startup processing having CMSIS5/RTX5 been available on GR-PEACH
For supporting tp CMSIS5/RTX5, I changed the start-up processing of 3 toolchains(ARMCC, GCC_ARM, IAR) and updated the register definition of PEACH specific.
In addition,
I changed the linker script files to implement the dynamic HEAP the same as Cortex-M targets.Since GR-PEACH's HEAP was a fixed area, I changed the label name(ZI_DATA to RW_IRAM1) and replaced the allocation of STACK/HEAP.
2017-12-21 14:09:24 +09:00
Martin Kojtal be52ba2156
Merge pull request #5363 from mprse/extended_rtc
Add support and tests for extended RTC
2017-12-12 17:36:44 +00:00
Przemyslaw Stekiel 106561669f Update RTC drivers for extended RTC. 2017-12-05 07:54:02 +01:00
Bartosz Szatkowski 717087c772 Renesas: Add empty mbed_rtx.h 2017-11-10 09:53:41 +00:00
Bartek Szatkowski c10dd0a725 RZ_A1H: Fix cmsis header name 2017-11-10 09:53:41 +00:00
mbedNoobNinja 610c8c85fc CAN Extended mode fix 2017-09-19 15:26:10 +03:00
Jimmy Brisson 1f94ede86c Merge pull request #4744 from deepikabhavnani/spi_issue_4743
Allow user to set default transfer byte for block read
2017-07-24 14:45:30 -05:00
Deepika 1b797e9081 Closed review comments
1. Doxygen and Grammar related
2. Change dummy to spi_fill
3. Remove NXP driver and add default loop in spi block read (same as all
other drivers)
2017-07-21 09:46:22 -05:00
Martin Kojtal 10ea63b8e7 Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
2017-07-13 12:23:25 +01:00
Jimmy Brisson c7d6bbe295 Upcase all assembler file extensions 2017-06-20 14:50:08 -05:00
Sam Grove 547320e99c Rename function st_rtc_localtime with _rtc_localtime 2017-06-07 23:24:48 -05:00
Vincent Coubard f880e44145 remove usage of mktime/localtime in favor of dedicated functions.
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa.
In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
2017-06-07 22:06:22 -05:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Martin Kojtal e229a49182 Merge pull request #4207 from geky/spi-remove-byte-locking
spi: Add SPI block-write to C++ and HAL for performance
2017-06-01 14:03:36 +02:00
Bartek Szatkowski 85cc9c8381 Remove deprecated RTX4 config options 2017-05-30 18:55:55 +01:00
Christopher Haster c1de19e49e spi: Added default spi_master_block_write implementation to all targets
There is an easy default implementation of spi_master_block_write that
just calls spi_master_write in a loop, so the default implementation
of spi_master_block_write has been added to all targets.
2017-05-25 12:04:58 -05:00