<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>mbedtls backend undefined reference to many things</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92561/mbedtls-backend-undefined-reference-to-many-things</link><description>Trying to setup mbedtls backend for AES CBC. Ive included the mbedtls_backend_aes.c and init.c, I&amp;#39;ve added the folders to the user include directories, I&amp;#39;ve enabled stuff in the sdk_config, I am getting a bunch of undefined reference errors 
 
 3&amp;gt; C:</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Oct 2022 14:16:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92561/mbedtls-backend-undefined-reference-to-many-things" /><item><title>RE: mbedtls backend undefined reference to many things</title><link>https://devzone.nordicsemi.com/thread/389236?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 14:16:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afe5928b-d0fa-4bab-b4d8-e5d7cca8c5f0</guid><dc:creator>JGusler</dc:creator><description>&lt;p&gt;Okay, for anyone finding this thread later, here is what all I had to do AES CBC encryption with mbedtls backend&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In mbedtls/config.h&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;uncomment MBEDTLS_MEMORY_BUFFER_ALLOC_C&lt;/li&gt;
&lt;li&gt;uncomment&amp;nbsp;MBEDTLS_PLATFORM_C&lt;/li&gt;
&lt;li&gt;uncomment&amp;nbsp;MBEDTLS_PLATFORM_MEMORY&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In sdk_config.h&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NRF_CRYPTO_ENABLED 1&lt;/li&gt;
&lt;li&gt;NRF_CRYPTO_ALLOCATOR 3&lt;/li&gt;
&lt;li&gt;NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED 1&lt;/li&gt;
&lt;li&gt;NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED 1&lt;/li&gt;
&lt;li&gt;might need&amp;nbsp;NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED 1, not sure, I added this part way through as part of my own requirements to randomly generate the initialization vector&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the flash_placement.xml&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verify you have&amp;nbsp;&amp;nbsp;&amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;Yes&amp;quot; name=&amp;quot;.crypto_data&amp;quot; inputsections=&amp;quot;*(SORT(.crypto_data*))&amp;quot; address_symbol=&amp;quot;__start_crypto_data&amp;quot; end_symbol=&amp;quot;__stop_crypto_data&amp;quot; /&amp;gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Depending on what development environment, make sure all the following are added to the project&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1664892931485v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And in main.c include all the following&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1664892950937v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This worked for me, should get you close if not the whole way there. It was a pain to figure out what was missing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mbedtls backend undefined reference to many things</title><link>https://devzone.nordicsemi.com/thread/389219?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 13:16:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08984ef0-d5e2-437a-8ec5-3e0501a6e851</guid><dc:creator>JGusler</dc:creator><description>&lt;p&gt;I don&amp;#39;t know, I thought having the includes in those files where the issues are would do the including, so I don&amp;#39;t know what my responsibility is in main vs the added on .c files&amp;#39; am as far as I can tell. And I can&amp;#39;t do that because I&amp;#39;m already doing that with other aspects, of this project. This is based on bl_app_uart and I want to add on crypto.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mbedtls backend undefined reference to many things</title><link>https://devzone.nordicsemi.com/thread/389182?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 11:20:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:820d3403-aafe-474a-bead-96759e70d03c</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;Have you already included the files that it&amp;#39;s complaining about? Sometimes you need to keep adding source files to your project since the files you just added is dependent on other source files that hasn&amp;#39;t been added to the project. For projects that use crypto lib, it would be easier to just start with a crypto example that already has included the necessary files and then add your code into that example.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>