Commit Graph

69 Commits (266d4c43a2e382d7013a98ca6a1cc14a5ffb83b5)

Author SHA1 Message Date
d-kato e96c6334f7 Refactoring system clock driver 2019-03-26 19:02:46 +09:00
d-kato 2509ea82fd Removed clock mode decision of "SystemCoreClockUpdate()"
Since GPIO.PPR0 can not check clock mode, I changed it to set a fixed value for each board.
2019-03-26 19:02:46 +09:00
d-kato cb31d11319 Fix the value of SystemCoreClock
The OS timer of RZ/A1 uses P0 clock, so until now it has been set the value of P0 clock in SystemCoreClock.
Changed the system clock value to set to SystemCoreClock.
Changed to refer to P0 clock macro instead of SystemCoreClock in OS timer processing.
2019-03-26 19:02:46 +09:00
d-kato d67af43202 Fix condition statement of write function 2019-03-11 10:42:54 +09:00
d-kato c5b01bf429 Add PWM pin for GR-LYCHEE 2019-03-07 12:26:53 +09:00
d-kato 9c8d263b4e Remove noise when duty is 0% and 100% 2019-03-07 12:13:06 +09:00
d-kato 09df3eb696 Changed PWM period setting register for RZ/A1 2019-03-07 12:07:24 +09:00
d-kato 70217338cb Refactoring PWM driver for RZ/A1 2019-03-07 12:00:57 +09:00
d-kato 7aebee07b1 GR_LYCHEE,RZ_A1H,VK_RZ_A1H: Update to fix ARMC6 build failures 2019-02-28 11:55:19 -06:00
Cruz Monrreal e1736cd06f
Merge pull request #9571 from mprse/fix_9523_rtos_less_issue
Update to 2-region model for HEAP and Stack Memory
2019-02-26 22:50:19 -06:00
d-kato 78923d8135 Add missing license description to RZ/A1 driver 2019-02-26 11:52:29 +09:00
Przemyslaw Stekiel e60a0f46e4 Remove duplicated _mbed_user_setup_stackheap, __rt_lib_init definitions.
Few targets already used 2-region memory model.
2019-02-19 15:46:32 -06:00
Russ Butler 8669417e7b Add HAL API for spi pinmap
Add the functions to get spi pinmaps to all targets.
2019-02-08 09:10:37 -06:00
Russ Butler 34c176654d Add HAL API for serial pinmap
Add the functions serial_tx_pinmap, serial_rx_pinmap, serial_cts_pinmap
and serial_rts_pinmap to all targets.
2019-02-08 09:10:28 -06:00
Russ Butler be492fe07a Add HAL API for pwmout pinmap
Add the function pwm_pinmap to all targets.
2019-02-08 09:10:19 -06:00
Russ Butler 22a89773fa Add HAL API for i2c pinmap
Add the functions i2c_master_sda_pinmap, i2c_master_scl_pinmap,
i2c_slave_sda_pinmap and i2c_slave_scl_pinmap to all targets.
2019-02-08 09:10:12 -06:00
Russ Butler 7e8695a2c5 Add HAL API for can pinmap
Add the functions can_rd_pinmap and can_td_pinmap to all targets.
2019-02-08 09:10:10 -06:00
Russ Butler 4818f88d73 Add HAL API for analog in pinmap
Add the function analogin_pinmap to all targets.
2019-02-08 09:09:51 -06:00
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