Commit Graph

93 Commits (08bd651ae4666420c38ff497c480788ea181918d)

Author SHA1 Message Date
Martin Kojtal 63eca294a1
Merge pull request #9163 from InfernoEmbedded/fix-8913-partner
Don't use define checks on DEVICE_FOO macros (partner code)
2019-01-07 16:37:24 +00:00
TomoYamanaka 3cdc314460 Modify the definition as to whether RTOS is not present in sys.cpp. 2019-01-04 09:43:34 +09:00
Alastair D'Silva aa80b7c70a Don't use define checks on DEVICE_FOO macros (partner code)
The DEVICE_FOO macros are always defined (either 0 or 1).

This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 20:02:29 +11:00
TomoYamanaka 65b4e72928 Modify IRQ handler processing without RTOS at Cortex-A IAR Compiler
In case of unusing RTOS, there is no processing against IRQ handler and it causes a linker error.
Therefore, I added this processing with WEAK attribute. Also I added cmain.S file at cmsis/TARGET_CORTEX_A folder.
2018-12-20 16:24:07 +09:00
TomoYamanaka dd8d8ea3c7 Modify IRQ handler processing without RTOS at Cortex-A GCC Compiler
In case of unusing RTOS, IRQ handler executes "while(1)" and it causes a program freeze.
Therefore, I revised this processing.
2018-12-20 16:19:04 +09:00
TomoYamanaka 240060ee69 Modify IRQ handler processing without RTOS at Cortex-A ARM Compiler
In case of unusing RTOS, IRQ handler executes "while(1)" and it causes a program freeze.
Therefore, I revised this processing. Also I added the heap setting processing and set the align to 8 byte.
2018-12-20 16:12:54 +09:00
David Saada 542744d03c Support erase value in Flash HAL drivers, FlashIAP and block devices 2018-11-07 14:23:07 +02:00
Cruz Monrreal deaa4fa0ff
Merge pull request #8374 from TomoYamanaka/improve_armcc_linkerscript
Renesas : Improve ARMCC linker script
2018-10-16 10:23:11 -05:00
Cruz Monrreal II 7a61a17ce4 Merge branch 'improve_spi_drv' of ssh://github.com/TomoYamanaka/mbed-os into TomoYamanaka-improve_spi_drv 2018-10-12 21:46:41 -05:00
Cruz Monrreal 285de88331
Merge pull request #8234 from TomoYamanaka/modify_LPTicker
Renesas : Modify LPTicker driver
2018-10-12 07:43:37 -05:00
TomoYamanaka 470f9bc375 Improve frequency setting proc of Renesas SPI driver
If the specified frequency exceeds the upper limit and lower limit at SPI driver, an error is output, but this does not match policy with other renesas drivers. Thus I revises the processing as follows.
- If "hz" is maximum over, it is rounded by the maximum value.
- If "hz" is minimum under, it is rounded by the minimum value.
2018-10-11 20:51:20 +09:00
TomoYamanaka 182a3a886f Improve ARMCC linker script for Renesas boards
For Arm toolchain build, Mbed 2(classic) programs occur an unexpected error if there is "#include "mem_XXXX.h"" in the script file.
It seems that the linker script can't find the include file because "mem_XXXX.h" file is not in the same path with the linker script.
(Refer to Issue #6975.)
To address this issue, I remove inclusion processing and define the related macros at ARMCC linker script file.
2018-10-11 16:51:06 +09:00
Deepika d120222b6c Renesas: Fix alignment of execute region to 8-byte boundary
--legacyalign, --no_legacyalign are deprecated from ARMC6 compiler, in order to
remove deprecated flags all linker files (GCC and IAR as well to have uniformity)
should strictly align to 8-byte boundary
2018-10-09 10:15:07 -05:00
TomoYamanaka cb087ed63a Revise the value of return value of flash_get_page_size()
Currently the return value of flash_get_page_size() is 1 since the min size per one writing is 1 byte by Flash spec.
However, I noticed that this value causes a enormous write time When writing large data such as FW update.
So I revised this value to 8 byte by considering the writing time, memory alignment and memory hole.
2018-09-29 05:22:37 +09:00
TomoYamanaka b01cdcba5a Modify typo of return value at mbed_get_a9_tick_irqn(). 2018-09-25 14:07:59 +09:00
TomoYamanaka 48038e4dcc Change MTU2 channel number for LPTicker of GR-LYCHEE
MTU2(Multi function Timer pulse Unit 2) can create the low freaquency.
Currently GR-LYCHEE uses MTU2 channel 3 for LPTicker, but I noticed that a part of it is used by another function.
Thus, I changed MTU2 channel number for LPTicker to 2.
2018-09-25 13:53:49 +09:00
TomoYamanaka d5ef4672b1 Support large Flash in Flash iap driver of Renesas
I addressed the cases Flash size is larger than 0x1000000.
2018-09-20 10:14:15 +09:00
TomoYamanaka d295eba9e5 Improve Flash iap driver of Renesas
I changed _page_program() func because "buf" which is an argument of data_send() for writing must be a RAM address in order to operate in SPI mode.
(ex: if it is ROM table data, writing will be failure.)
Also, I changed the period of interrupt disable/enable at _page_program() func and _sector_erase() func because lock period is too long.
2018-09-20 10:08:20 +09:00
Yossi Levy acfda5895e Changes in PR #7774 of PinNames.h should be reverted. This commit reverts those files excpet for K82F and K64F which are left as an example 2018-09-05 14:13:05 +03:00
Yossi Levy ed8e170d15 Moving SD, SPIF and FLASHIAP into mbedos and refactoring features storage directory structure. 2018-08-29 12:01:11 +03:00
David Saada 84412d6493 Rename text region in ARM linker file for Renesas & Realtek boards 2018-08-08 14:56:58 +03:00
TomoYamanaka 04fcd33f15 Renesas : Improve Flash iap
I modified the _page_program() because when the request of the size exceeding the maximum size(256 byte) per one writing of Flash recieved, it was not able to loop the writing with sifting the address every 256 byte.

Also I modified the return value of flash_get_page_size() because I found that the minimum size per one writing of Flash is 1 byte by reviewing Flash spec.
"FLASH_PAGE_SIZE" macro's value is remain 256, it doesn't be used at flash_get_page_size(), used at _page_program() for refferencing of the maximum page size.
2018-08-02 13:48:56 +09:00
TomoYamanaka 87496df078 Add the clear process of "inited" flag in lp_ticker_free()
I added "lp_ticker_inited = 0" in lp_ticker_free() of lp_ticker.c, so
re-initialization will work.
2018-07-31 19:22:04 +09:00
TomoYamanaka 52cbc33d44 Implementation of LPTICKER feature for Renesas mbed boards
Although other venders implement this feature by using RTC, in my H/W(RZ_A1), I cannot use RTC because it does not satisfy the spec of LP Ticker (ms order and low frequency between 8 KHz and 64 KHz).
Therefore I implemented this feature by creating 1024 division by MTU2(Multi function Timer pulse Unit 2) in order to satisfy this spec.
As a result of investigating, the most unaffected channel among MTU2 placed on GR-PEACH and GR-LYCHEE was channel 3, so I use channel 3 for this feature.

- mbed_drv_cfg.h
  I added a macro of MTU2 channel to this file for commonalizing code for GR-PEACH and GR-LYCHEE, and referenced it's macro at us_ticker.c.
- targets.json
  I added a macro for enabling LP Ticker.
- mtu2.c mtu2.h
  I defined fuction of MTU2's clock supply and stop.
  Because MTU2 is utilized by pwm driver too, those function were referenced at lp_ticker driver and pwm driver.

- lp_ticker.c lp_ticker_init()
  In order to satisfy the LP Ticker spec, I implemented by creating 1024 division by MTU2.
  When an interrupt is required, it will be set with ticker_set_interrupt().

- lp_ticker.c lp_ticker_free()
  This function stops the counting and powerdown the lp_ticker.

- lp_ticker.c lp_read()
  This function returns the timer counter of MTU2.

- lp_ticker.c lp_ticker_set_interrupt()
  In order to satisfy specifications, I implemented lp_ticker_set_interrupt() function.

- lp_ticker.c lp_ticker_fire_interrupt()
  In order to satisfy spec, I implemented lp_ticker_fire_interrupt() function.
  Also I added GIC_EnableIRQ for allowing the interrupt at end of function.

- lp_ticker.c lp_ticker_get_info()
  To satisfy the spec, I implemented lp_ticker_get_info() function. The value of freq includes rounding off.
2018-07-31 19:22:03 +09:00
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