Commit Graph

182 Commits (ab7b93ca583fe0779dd52f0ee41e41fed70ee2c5)

Author SHA1 Message Date
Prashant Ravi a4ce936947 reverting all tabs to spaces 2017-12-12 21:05:27 +08:00
Prashant Ravi 01ec0da7f2 Replacing formatting issues 2017-12-12 17:09:42 +08:00
Prashant Ravi 01808db8ff Moving changes to RTW driver 2017-12-12 16:57:28 +08:00
Prashant Ravi 199ab8711a Revert "Fixing changes to make greentea test mbed-os-tests-netsocket-connectivity pass for target Realtek AMEBA"
This reverts commit 1fcfced203.
2017-12-12 16:53:45 +08:00
Prashant Ravi 1fcfced203 Fixing changes to make greentea test mbed-os-tests-netsocket-connectivity pass for target Realtek AMEBA 2017-12-04 19:18:24 +08:00
Martin Kojtal e4133501f1
Merge pull request #5531 from tung7970/feature-fota
RTL8195AM - refactor bootloader and fota support
2017-11-30 18:12:48 +00:00
Janne Kiiskilä 791343a1f7 Realtek RTL8195AM - define A3-A5 as NC
Based on the Mbed OS website the A3 is connected to "DAC", however there
is no define for DAC. In order to get the Realtek RTL8195AM to even compile
with mbed-os-example-client now, we must have the A3 defined - it is one of
the standard Arduine header pins. Therefore, setting it as NC.

A4-A5 are not connected either, so adding them as "NC" as well.

Realtek will hopefully push a proper fix sooner or later, if there is a
more meaningful define for the A3 pin. They do state however that the
A0-A3 pins are not GPIO capable anyway.

Ref: https://os.mbed.com/platforms/Realtek-RTL8195AM/
2017-11-29 12:35:02 +02:00
Tony Wu a4575a965f rtl8195am - refactor bootloader and ota support
1. move ota region 1 from 0x00b000 to 0x040000
2. move ota region 2 from 0x0c0000 to 0x120000
3. refactor bootloader header as follows:

   uint32_t tag;
   uint32_t ver;
   uint64_t timestamp;
   uint32_t size;
   uint8_t hash[32];
   uint8_t campaign[16];
   uint32_t crc32;

   where,
   a. hash is the sha256 checksum of the payload.
   b. crc32 is the crc32 checksum of headers from tag to campaign.

4. Call NVIC_SystemReset for soft reset.

Signed-off-by: Tony Wu <tung7970@gmail.com>
2017-11-28 21:33:51 +08:00
Veijo Pesonen ee77079c47 REALTEK_RTL8195AM Wifi driver - adds check of credentials
Adds checks that SSID is non-empty and that password is 8-63 characters
long when security is enabled
2017-11-24 13:08:22 +02:00
Martin Kojtal 41eb565d9c
Merge pull request #5342 from ARMmbed/feature_cortex_a
Update CMSIS/RTX with Cortex-A support
2017-11-15 11:24:36 +00:00
Jimmy Brisson f0912554d5
Merge pull request #5473 from marcuschangarm/rtl8195am_ota
Reorganize defines for firmware updates on Realtek RTL8195AM
2017-11-13 10:59:28 -06:00
Jimmy Brisson 4185c1a6cf
Merge pull request #5471 from marcuschangarm/rtl8195_flash_page
Increase flash program granularity on Realtek RTL8195AM
2017-11-13 10:58:50 -06:00
Jimmy Brisson 757a4e3b75
Merge pull request #5464 from Archcady/Fix_lockup
Fix lockup issue for REALTEK_RTL8195AM
2017-11-13 10:54:37 -06:00
Tony Wu a451498141 rtl8195am - remove redundant header file inclusion
Signed-off-by: Tony Wu <tung7970@gmail.com>
2017-11-10 09:53:42 +00:00
Marcus Chang a0729952a3 Reorganize defines for firmware updates on Realtek RTL8195AM
Moved defines, typedefs and function prototypes from ota_api.c to
ota_api.h so that these can be included in applications.
2017-11-09 10:27:59 -08:00
Marcus Chang 5fe03afea6 Increase flash program granularity on Realtek RTL8195AM
The Page size has been set to 1 byte instead of the previous 256.
Although 256 is the physical page size, the driver supports
writing 1 byte at a time.
2017-11-09 09:51:06 -08:00
Yuguo Zou 6af9a5a002 Remove lines to improve readability 2017-11-09 18:23:17 +08:00
Yuguo Zou 05cf4680bd Update HAL library to fix lockup issue 2017-11-09 17:59:14 +08:00
Marcus Chang f44a15454b Increase flash size on Realtek RTL8195AM
The Realtek RTL8195AM has 2 MiB of external flash. This change
enables the FlashIAP driver to gain access to the full flash.
2017-11-07 09:25:24 -08:00
Yuguo Zou bf3d68ee88 Update HAL code to resolve ticker lockup issue 2017-11-07 17:02:42 +08:00
Tony Wu 07646db24c rtl8195am - fix us_ticker interrupt handling
TIMER2_7_IRQ is shared among several timer sources, including
us_ticker. Raising TIMER2_7_IRQ pending bit will trigger the timer
interrupt, but the timer interrupt handler will not know which timer
source this interrupt is for. This patch sets timer load value to one
tick and force us_ticker to fire almost "immediately".

TIMER2_7_IRQ is handled through a common interrupt handler, and
is automatically cleared. Therefore, there is no need to clear IRQ.

The underlying timer HAL treats load value as micro-seconds and does
conversion internally. Therefore, simply pass micro-seconds to timer
HAL without converting to tick first.

Signed-off-by: Tony Wu <tung7970@gmail.com>
2017-11-07 11:44:43 +08:00
Anna Bridge ea43b437a6 Merge pull request #5352 from Archcady/fix-event-lockup
Fix us_ticker collision and race for RTL8195AM
2017-10-26 11:01:06 +01:00
Tony Wu 1ee88fb0f6 rtl8195am - fix us_ticker collision and race
Switch to timer 2 for us_ticker for timer 6 might be used
for power saving.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-10-20 17:10:02 +08:00
Tony Wu a35c76d805 rtl8195am - remove redundant file
This file is unused and redundant.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-10-11 21:54:23 +08:00
Tony Wu f5b668a9fc rtl8195am - fix IAR zero padding issue
Remove redundant memory regions, and merge multiple RAM regions into one
to solve ielftool zero padding issue.

The side effect is less control over object files placement. It's all up
to linker's best effort.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-10-11 21:54:23 +08:00
Tony Wu e57d184fb0 rtl8195am - cleanup IAR icf file
Cleanup ICF file. No logic change.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-10-11 21:54:23 +08:00
Tony Wu d0de5f792e rtl8195am - fix ARMC6 guards
Fix ARMC6 guard typo introduced in commit 4f3f0cc9cc (Make Realtek link)

While at it, remove redundant ISR_STACK_SIZE assignment for ARMCC.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-10-02 23:45:47 +08:00
Tony Wu 5e36d32d86 rtl8195am - remove obsolete configs
The following configs were no longer necessary for RTX5.
    OS_TASKCNT
    OS_MAINSTKSIZE
    OS_CLOCK

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-10-02 14:37:05 +08:00
Tony Wu 6c1167844a rtl8195am - fix us_ticker porting
commit f7bc126 (Re-work Rtl8195AM ticker) tried to address ticker drifting
issue, but in fact broke ticker functionality. This patch adjusts us_ticker
porting to unbreak it, and to fix the following tests:

mbed-os-tests-mbed_drivers-ticker
mbed-os-tests-mbed_drivers-timeout
mbed-os-tests-mbedmicro-rtos-mbed-isr
mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler
mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async
mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate

Changes are:

1. Dont disable timer after every us_ticker interrupt. That basically
   breaks ticker functionality.

2. Fine-tune us to tick conversion macro. Previous conversion method
   yields 1 tick drift every 2 ms.

3. Remove special placement of ticker objects. No longer necessary.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-09-20 11:03:22 +08:00
Anna Bridge 003dd7c47f Merge pull request #5044 from Archcady/Profile_debug
Realtek_RTL8195AM fix for debug profile
2017-09-19 10:43:25 +01:00
Jimmy Brisson aeda7f7d28 Merge pull request #5069 from deepikabhavnani/assert_added
Changed error print to assert
2017-09-15 17:50:49 -05:00
Yuguo Zou f7bc12626d Re-work Rtl8195AM ticker
Remove intermediate variances and use uint64 instead;
Remove HalTimerIrqEn called in us_ticker.c
2017-09-15 18:53:24 +08:00
Jimmy Brisson 45b59b442b Correct long call macros for ARMC6 2017-09-13 09:48:55 -05:00
adbridge 32bd25e8df Fix include file for ARMCC 6, should use cmsis_armclang.h 2017-09-12 16:41:11 +01:00
Jimmy Brisson 4f3f0cc9cc Make Realtek link
There was some interesting stuff here.
 * ARMC6 treats assembly the same as GNU, but has a different startup
   function, so we branch the asm there
 * Incorrect discriminant, probably copied from other ports
2017-09-11 13:20:33 -05:00
Jimmy Brisson 15a9a0382b Enable Compiling with ARMC6 across all targets
remove duplicate sys.cpp
2017-09-11 13:20:32 -05:00
Deepika 65150b62b9 Added assert for malloc 2017-09-11 11:41:34 -05:00
Anna Bridge cab660d980 Merge pull request #4938 from deepikabhavnani/IAR_fixes
Update IAR to version 8
2017-09-11 17:28:38 +01:00
Yuguo Zou ba3bb7ea35 Remove unused code
Clean rtl8195a_init.c a little bit
2017-09-07 15:10:08 +08:00
Yuguo Zou 2642ab321e Update wlan lib to fix debug profile
The issue of mutex returning osErrorISR with debug profile is fixed
2017-09-07 11:05:06 +08:00
Yuguo Zou 1d6a69b3e6 Update MSP setup
Use asm code to set MSP
2017-09-07 10:58:45 +08:00
Jimmy Brisson 7457bbbc5c Merge pull request #4665 from Archcady/enable_sdram
Enable sdram usage of REALTEK_RTL8195AM
2017-09-06 14:26:34 -05:00
Deepika d12822f95a Resolved compiler error: constructor deleted
IAR 8.x compiler throws error for emac_interface_t constructor
rtw_emac.cpp@220,0: [Pe1790]: the default constructor of "emac_interface"
cannot be referenced -- it is a deleted function

Error is because new object is created of structure with constant member.
Resolved it by using malloc instead new.
2017-09-06 09:51:17 -05:00
Yuguo Zou 67f1ee5343 Resolve including directory issue in GCC linker script for Ameba
Should not make assumption of specific directory when include .h from
linker script
2017-09-05 19:11:38 +08:00
Yuguo Zou c834b7faac Fix bugs for RTL8195AM with debug profile of compilers
1. Add alignment / padding for postbuild segments
2. Clear tcm.bss section
3. Remove TRAP_OverrideTable(), move lines to PLAT_Start()
2017-08-28 19:04:26 +08:00
Yuguo Zou c530be0eeb Fix stack underflow issue
Switch on TCM
2017-08-23 16:12:07 +08:00
Yuguo Zou 1e398cfc60 Add RTL8195AM support for mbed client with IAR
Move ticker related code to SRAM due to time drift sensitive
2017-08-22 17:34:00 +08:00
Yuguo Zou e16c2d2833 Add RTW8195AM support for mbed client with ARMCC
Move ticker related code to SRAM due to time drift sensitive
2017-08-22 17:33:41 +08:00
Yuguo Zou 215a7906d3 Change to use copy assignment operator for RTWInterface::scan 2017-08-10 17:36:05 +08:00
Yuguo Zou f24a40906a Use placement new to optimize wifi scan 2017-08-07 11:23:30 +08:00
Yuguo Zou 56a98e11d1 Move ticker related text to SRAM to fix GCC mbed-os-tests-mbed_drivers-timeout failing issue 2017-08-03 11:06:24 +08:00
Yuguo Zou 1d06bf4279 Disambiguate function __memset() in rtl8195a_init.c
When use ARMCC, __memset is replaced by ARM's version which will make
boot process hang.
2017-08-01 17:45:04 +08:00
Yuguo Zou 49a7e4b59e Fix GCC compile errors 2017-08-01 17:03:01 +08:00
Tony Wu 35d7ca27be rtl8195am - fix ARMCC SRAM + SDRAM porting
Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-08-01 15:29:21 +08:00
Yuguo Zou d1c87347af Fix ARMCC & IAR compile errors 2017-07-28 18:33:52 +08:00
Yuguo Zou 2654d2c433 Switch off DBG messages
And clean up some unused debug messages
2017-07-27 18:51:57 +08:00
Tony Wu c9ecb2749d rtl8195am - adjust memory layout and enable fota support
1. Rearrange SDRAM and SRAM layout. Move timing critical code to SRAM,
   and the rest to SDRAM.

2. Add bootloader that's capable of FOTA over mbed cloud.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-07-27 13:55:45 +08:00
Tony Wu 37739937ca rtl8195am - rename GCC_ARM linker script
Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-07-27 13:55:44 +08:00
Yuguo Zou 2864e4b05d enable sdram usage of REALTEK_RTL8195AM
Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-07-27 13:55:42 +08: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
Jimmy Brisson d5108e5a7a Merge pull request #4714 from bulislaw/expose_systemcoreclock
Expose SystemCoreClock via cmsis.h to support new CMSIS/RTX
2017-07-24 10:59:47 -05:00
Jimmy Brisson 7a153ce337 Merge pull request #4754 from Archcady/TLS
Resolve TLS handshake failing issue for REALTEK_RTL8195AM
2017-07-24 10:55: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
Marcus Chang 1930c4b136 REALTEK_RTL8195AM: FlashIAP read and address scope
The FlashIAP is supposed to have access to the full application
memory, so the address scope has been changed to encompass
the entire external flash.

The address translation has also been changed to reflect the memory
layout in the documentation:

 Realtek Ameba1 Memory Layout: 5.1 Flash Memory
2017-07-19 14:24:50 +01:00
Jimmy Brisson adfed0f9de Merge pull request #4644 from 0xc0170/fix_ticker_delta_negative
Ticker: add fire interrupt now function
2017-07-17 11:05:46 -05:00
Yuguo Zou 2ec8b04074 Resolve TLS handshake failing issue
this issue, relating to wifi thread priority,  makes blocking TCP socket
failing
2017-07-14 11:21:53 +08:00
Bartek Szatkowski 03e80119b5 REALTEK_RTL8195AM: Expose SystemCoreClock via cmsis.h
This change is necessary as updated CMSIS/RTX require the
SystemCoreClock symbol.
2017-07-13 15:49:33 +01:00
Martin Kojtal 43a361214a Merge pull request #4667 from Archcady/mute_debug_msg
Update and mute debug messages of REALTEK_TRL8195AM
2017-07-13 16:47:31 +02: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
Yuguo Zou d46cc2ad3f Remove unused headfile
This shall prevent confusion
2017-07-12 17:49:52 +08:00
Yuguo Zou b435ff4a16 Enable/Disable debug from argument of constructor 2017-07-12 17:40:24 +08:00
Yuguo Zou c7111c429e mute wifi_conf messages 2017-07-12 12:13:05 +08:00
Yuguo Zou b7f1e73f97 Update and mute debug messages from wifi 2017-06-29 16:40:01 +08:00
Yuguo Zou f7b2edc88c Coding style fix 2017-06-27 11:33:46 +08:00
Yuguo Zou 0de89c7712 Add FlashIAP support for REALTEK_RTL8195AM 2017-06-15 16:27:08 +08:00
Sam Grove f31ea01237 Merge pull request #4487 from Archcady/Realtek_TCM
Resolve Realtek device small code space issue
2017-06-11 01:09:51 -05:00
Yuguo Zou f4522134ed Resolve Realtek device small code space issue
switch on TCM section usage, this should give user code more codespace.
2017-06-10 09:46:01 -05:00
Jimmy Brisson d06e2169fd Correctly name rom.a 2017-06-09 00:03:22 -05:00
Russ Butler 96288e3eef Simplify Ameba RTC driver
The Ameba RTC driver converts time_t to
second/minute/hour/day/month/year in rtc_write and back to time_t in
rtc_read. Replace this with an implementation which uses time_t
directly.
2017-06-07 22:03:27 -05:00
Sam Grove 02bf926ffb Proper fix for 1fa30b7403
Replace #define with typedef
2017-06-04 11:26:21 -05:00
Sam Grove be35b3fb81 spi: Added default spi_master_block_write implementation to REALTEK_RTL8195AM
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-06-03 17:14:11 -05:00
Yuguo Zou 3c3a9a67fe fix STRINGIFY redefining issue 2017-06-03 20:15:05 +01:00
Yuguo Zou fdea7b146c fix icf file misspelling 2017-06-03 20:15:05 +01:00
Yuguo Zou b76c8a93c5 clean up GPL license with APACHE2.0 2017-06-03 20:15:05 +01:00
Yuguo Zou f71f578435 Switch to rtx2
remove rtx and switch to rtx2
2017-06-03 20:15:05 +01:00
Yuguo Zou c31d5479be fix multiple i2c peripherals possible conflicting issue 2017-06-03 20:15:04 +01:00
Yuguo Zou 4eda93e760 resolve RTWInterface initialization run after error issue 2017-06-03 20:15:04 +01:00
Yuguo Zou e2891647f2 add comment for the delay in analogout_api.c
see analogout_init()
2017-06-03 20:15:04 +01:00
Yuguo Zou 0c046a4c38 improve coding style 2017-06-03 20:15:04 +01:00
Yuguo Zou 005ce58f44 cmsis5\rtx5 put NVIC vector ops in mbed_boot.c 2017-06-03 20:15:04 +01:00
Yuguo Zou e8fd5bbdf4 move archives into target specific directories 2017-06-03 20:15:03 +01:00
Yuguo Zou c160d5b1cd Ported code of CMSIS5/RTX2
temporarily comment out these code to prevent conflict with RTX
2017-06-03 20:15:02 +01:00
Yuguo Zou 6c82b51f78 an I2C fix
an I2C fix for updated CI-test
2017-06-03 20:15:01 +01:00
Yuguo Zou f000eb3401 Restore TCPIP_THREAD_STACKSIZE and thread_stack_main
move some TCPIP stack data to heap;
switch off GDMA for SPI (only for SPI);
TCPIP_THREAD_STACKSIZE and thread_stack_main are identical to ARMmbed
2017-06-03 20:15:01 +01:00
Yuguo Zou c3bf1c5006 remove unused class member from RTWInterface 2017-06-03 20:15:00 +01:00
Yuguo Zou 6f24e9e8e9 Clear Wlan code in permissive-binary-license
These code are put in binary library or they are unused .h files
2017-06-03 20:15:00 +01:00
Yuguo Zou 0430b94896 code style fix #2 2017-06-03 20:14:59 +01:00
Yuguo Zou d18735dd31 code style fix
replace tab with 4 spaces;
remove "#ifndef CONFIG_MBED_ENABLED" code;
make if else pretty;
add comment to PinNames.h;
2017-06-03 20:14:59 +01:00
Yuguo Zou 0650ad1384 greentea heap&stack fix 2017-06-03 20:14:59 +01:00
Yuguo Zou 15d58690e9 fold static variables in RTWInterface.cpp to .h, modify lwipopts.h TCPIP_THREAD_STACKSIZE 2017-06-03 20:14:59 +01:00