Modifing UART driver (UART_Handler_func)

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
mapart
Offline
Last seen:1 month 1 week ago
加入:2018-11-30 15:58
Modifing UART driver (UART_Handler_func)

Hi,

I'd like to use the uart to interface a gnss which spits out NMEA data and in order to achive this I'd like to modify the UART driver.

I've imported the file which holds the definitions for (among other functions) UART_Handler_func into my project (based on ble_app_security), and when trying to compile I get the following errors:

.\out_585\ble_app_security_585.axf: Error: L6200E: Symbol UART_Handler_func multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_finish_transfers_func multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_flow_off_func multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_flow_on_func multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_init_func multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_read_func multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_write_func multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_set_flow_off_retries_limit multiply defined (by da14585_symbols.txt and uart_ea.o). .\out_585\ble_app_security_585.axf: Error: L6200E: Symbol uart_env multiply defined (by da14585_symbols.txt and uart_ea.o).

Why are these functions defined in da14585_symbols.txt?
How can I modify the driver in the easiest possible way?

Best regards

Martin

Device:
PM_Dialog
Offline
Last seen:1 hour 15 min ago
工作人员
加入:2018-02-08 11:03
Hi mapart,

Hi mapart,

This is an error form the linker because all of the functions are executed by the ROM code. I would not recommend you to modify the UART driver but if you would like to do it you should override the functions from the ROM code. For example if you would like to have your own uart_finish_transfers_func() you should do the following modifications:

  • In da14585_symbols.txt file which is under sdk\common_project_files\misc SDK path, comment it out. You should use the << ; >> symbol for this scope..

  • Comment out this function from user_config_defs.h and jump_table.c . In jump_table.c you should comment it out both the function’s reference and from the rom_func_addr_table_var[]

You should follow this procedure for all the functions that you are using.

Thanks, PM_Dialog

mapart
Offline
Last seen:1 month 1 week ago
加入:2018-11-30 15:58
Hi,

Hi,

Thanks for your answer!

Just to make sure I understand this correctly:

  • The UART driver (for uart1) is precompiled and written to ROM during manufacturing
  • The sourcecode for the precompiled driver is uart.c
  • da14585_symbols.txt holds the symbols for the ROM

Is this correct?
然后我有一个问题:

What is the purpose of having both "uart_init_func" and "uart_init", "UART_Handler_func" and "UART_Handler", et.c. ?

Best regards

Martin

PM_Dialog
Offline
Last seen:1 hour 15 min ago
工作人员
加入:2018-02-08 11:03
Hi mapart,

Hi mapart,

Yes, you are correct! The purpose is to override the ROM functions and use your custom uart_init_func etc. As I mentioned in my previous post, this error comes from the linker because all of the functions are executed by the ROM code. If you found any answer useful, please mark it as accepted.

Thanks, PM_Dialog