<?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>Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86427/turning-camera-off-in-nrf52-ble-image-transfer-demo-for-nrf52840-dongle</link><description>Hello everyone, I&amp;#39;d like to implement the nrf52-ble-image-transfer-demo for nRF52840 Dongle. The normal code already plays well. However, since I am aiming for a low-power application, I need to somehow put the camera in sleep mode while it is not used</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Apr 2022 15:50:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86427/turning-camera-off-in-nrf52-ble-image-transfer-demo-for-nrf52840-dongle" /><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/364308?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 15:50:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ffd69cb-e7ee-4106-896c-d6fe8e84a134</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Did you erase the dongle before programming the application? If not, the MBR and bootloader on the dongle may not be able to boot the application correctly. Erasing the dongle (using eraseall operation) will set the GPIO voltage to 1.8V, so make sure you have a debugger that supports this voltage before erasing.&lt;/p&gt;
&lt;p&gt;Can you post the exact steps you used to program the dongle, and which example(s) you have tried to program?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/363278?ContentTypeID=1</link><pubDate>Thu, 14 Apr 2022 12:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3296da50-943a-43d5-80f9-454d614a3f87</guid><dc:creator>Paul M.</dc:creator><description>&lt;p&gt;I tried now to debug via the SWD port and the P19 debug output of the DK. The&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;dongle programming tutorial&lt;/a&gt;&amp;nbsp;says that I should be able to program the dongle now like any other DK, so I tried to program it with the functioning code I programmed with the NRF Connect tool via SEGGER. It does not work, however. I also included the following code at the beginning of my main as it was described in the tutorial.&lt;/p&gt;
&lt;p&gt;Where could the problem be?&lt;pre class="ui-code" data-mode="text"&gt;if ((NRF_UICR-&amp;gt;REGOUT0 &amp;amp; UICR_REGOUT0_VOUT_Msk) ==
    (UICR_REGOUT0_VOUT_DEFAULT &amp;lt;&amp;lt; UICR_REGOUT0_VOUT_Pos))
{
    NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen;
    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}

    NRF_UICR-&amp;gt;REGOUT0 = (NRF_UICR-&amp;gt;REGOUT0 &amp;amp; ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
                        (UICR_REGOUT0_VOUT_3V0 &amp;lt;&amp;lt; UICR_REGOUT0_VOUT_Pos);

    NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}

    // System reset is needed to update UICR registers.
    NVIC_SystemReset();
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/362392?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 13:58:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd35285d-278d-4e93-92eb-a9d477916f42</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;As long as the SWDIO and SWDCLK pins are connected to P20 of the DK, you should only have to power the Dongle with the same voltage level that the DK is running at (3.0V), and connect the VTG pin of P20 header to VDD on the DK. If you power the dongle through the USB port, the default voltage should be 3.0V, but make sure you do not do an eraseall operation from the debugger (see previously linked&amp;nbsp;tutorial for details).&lt;/p&gt;
&lt;p&gt;I do not see any reasons you should need to cut the D+/- lines of the USB port. It looks like the user in that thread have modified the dongle to connect SWDIO/CLK to the D+/- pads.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/362164?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 17:59:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfade15a-d464-45b6-9d04-8bac20e968db</guid><dc:creator>Paul M.</dc:creator><description>&lt;p&gt;Furthermore, how do I debug using the&amp;nbsp;&lt;span&gt;SWDCLK/SWDIO? I already connected them to the&amp;nbsp;P20 SWD of the DK, but what other steps must I take? I have read the discussion&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38390/program-the-pca10059-with-pca10056"&gt;Program the pca10059 with pca10056&lt;/a&gt;&amp;nbsp;that the D- and D+ must be cut. Are those the SB3 and SB4 bridges? What else must I do? Do I still need to plug the dongle into the USB port for power, and must the DK also be connected to my pc?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks in andvance!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/361531?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2022 13:12:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd01a32a-a62e-477b-b51a-3d094e80c4da</guid><dc:creator>Paul M.</dc:creator><description>&lt;p&gt;The code (for nRF 52840, not dongle) would be: first, at the beginning of the main and before the initialization, I clear the pin for the gate of my p-channel MOSFET:&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg_output(32 + 8);&lt;br /&gt; nrf_gpio_pin_clear(32 + 8);&lt;/p&gt;
&lt;p&gt;so that the camera is powered. Then, after the&amp;nbsp;initialization and before the advertising_start function, i set the pin again so that the camera is shut down and does not drain current anymore:&lt;/p&gt;
&lt;p&gt;nrf_gpio_pin_set(32 + 8);&lt;/p&gt;
&lt;p&gt;advertising_start();&lt;/p&gt;
&lt;p&gt;In the for-loop, when the take picture command comes in, I clear the gate pin again so that the camera is powered again, call the camera_init_new() function to initialize the camera again, and proceed with the code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;switch(new_command)&lt;br /&gt; {&lt;br /&gt; &lt;br /&gt; case APP_CMD_SINGLE_CAPTURE:&lt;br /&gt;nrf_gpio_pin_clear(32 + 8);&lt;br /&gt; nrf_delay_ms(4);&lt;br /&gt; camera_init_new();&lt;br /&gt; nrf_delay_ms(500);&lt;br /&gt; if(arducam_mini_2mp_bytesAvailable() == 0)&lt;br /&gt; {&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Starting capture...&amp;quot;);&lt;br /&gt; arducam_mini_2mp_startSingleCapture();&lt;br /&gt; image_size = arducam_mini_2mp_bytesAvailable();&lt;br /&gt; NRF_LOG_INFO(&amp;quot;Capture complete: size %i bytes&amp;quot;, (int)(image_size));&lt;br /&gt; ble_its_img_info_t image_info;&lt;br /&gt; image_info.file_size_bytes = image_size;&lt;br /&gt;&lt;br /&gt; ble_its_img_info_send(&amp;amp;m_its, &amp;amp;image_info);&lt;br /&gt;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;At the end of the image transfer loop, I check&amp;nbsp;if the&amp;nbsp;arducam_mini_2mp_bytesAvailable() == 0 to set the gate pin again to shut the camera down.&lt;/p&gt;
&lt;p&gt;I use the altered camera_init_new() function instead of the camera_init() function because the code did not work with using the normal camera_init() function. I do not know completely yet, but I assume this is due to the camera_init() function also initializing the necessary Pins of the nRF, which can&amp;#39;t be initialized more than once. So these were the changes I made in the camera_init() function: instead of calling the&amp;nbsp;arducam_mini_2mp_open(&amp;amp;m_camera_init) function, i introduced the&amp;nbsp;arducam_mini_2mp_open_new(&amp;amp;m_camera_init) function, where I left everything the same except for removing the&amp;nbsp;arducam_spiRegisterCallback(spiCallback); function:&lt;/p&gt;
&lt;p&gt;void arducam_mini_2mp_open_new(arducam_mini_2mp_init_t *config)&lt;br /&gt;{&lt;br /&gt; // put your setup code here, to run once:&lt;br /&gt; uint8_t vid, pid;&lt;br /&gt; uint8_t temp;&lt;br /&gt; arducam_new_init(OV2640, config-&amp;gt;pinScl, config-&amp;gt;pinSda, config-&amp;gt;pinCsn, config-&amp;gt;pinMosi, config-&amp;gt;pinMiso, config-&amp;gt;pinSck);&lt;/p&gt;
&lt;p&gt;//nrfSystem.registerError(LS_DEBUG, &amp;quot;ARDUCAM&amp;quot;, 0, &amp;quot;Camera Start&amp;quot;);&lt;br /&gt; &lt;br /&gt; //arducam_spiRegisterCallback(spiCallback);&lt;br /&gt; &lt;br /&gt; //Check if the ArduCAM SPI bus is OK&lt;br /&gt; arducam_write_reg(ARDUCHIP_TEST1, 0x55);&lt;br /&gt; temp = arducam_read_reg(ARDUCHIP_TEST1);&lt;br /&gt; //Serial.println(temp);&lt;br /&gt; if (temp != 0x55)&lt;br /&gt; {&lt;br /&gt; //nrfSystem.registerError(LS_ERROR, &amp;quot;ARDUCAM&amp;quot;, 0, &amp;quot;SPI interface non responsive&amp;quot;); &lt;br /&gt; while(1);&lt;br /&gt; }&lt;br /&gt; //Check if the camera module type is OV2640&lt;br /&gt; arducam_wrSensorReg8_8(0xff, 0x01); &lt;br /&gt; arducam_rdSensorReg8_8(OV2640_CHIPID_HIGH, &amp;amp;vid);&lt;br /&gt; arducam_rdSensorReg8_8(OV2640_CHIPID_LOW, &amp;amp;pid);&lt;br /&gt; if ((vid != 0x26) || (pid != 0x42))&lt;br /&gt; {&lt;br /&gt; //nrfSystem.registerError(LS_ERROR, &amp;quot;ARDUCAM&amp;quot;, 0, &amp;quot;TWI interface non responsive&amp;quot;); &lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt; //nrfSystem.registerError(LS_DEBUG, &amp;quot;ARDUCAM&amp;quot;, 0, &amp;quot;OV2640 module detected&amp;quot;); &lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;arducam_set_format(JPEG);&lt;br /&gt; arducam_InitCAM();&lt;br /&gt; //arducam_OV2640_set_JPEG_size(OV2640_160x120);&lt;br /&gt; nrf_delay_ms(10);&lt;br /&gt; arducam_clear_fifo_flag();&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Also, after calling the camera_init_new() function I need to go into a delay for ca 500 ms. I do not know why, since the necessary delays needed for the camera to initialize are already put in the camera_init() and camera_init_new() function, but that was something I determined by trying.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, this code does work on the nRF52840, however, it does not on the Dongle (of course after adjusting the pin numbers).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/361250?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 13:18:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68befb43-7204-4dc8-bc6b-2f59ee512ed6</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Paul M."]The Image demo example does run without problems, only when I introduce the code which disables the camera via MOSFET does it crush. However, the same does not happen on the normal nrf52840. The GPIO I use for the gate of the MOSFET is pin 1.10 (I address it in the code with 32+10).[/quote]
&lt;p&gt;What exactly does this function do? Can you post the code?&lt;/p&gt;
[quote user="Paul M."]I do not have any debug capabilities, how could I using the Dongle?[/quote]
&lt;p&gt;You can solder a 10-pin debug header on the back of the dongle (e.g. &lt;a href="https://www.adafruit.com/product/752"&gt;this&lt;/a&gt;), and use a &lt;a href="https://www.adafruit.com/product/1675"&gt;cable&lt;/a&gt; between this and the &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/dk/hw_debug_out.html"&gt;debug output&lt;/a&gt; (P19) port of a nRF52xxx DK. Alternatively, you can solder headers/pins to the SWDCLK/SWDIO pads close to the USB port on the dongle and connect these to the P20 SWD debug output pins on the DK to debug the application. It is also possible to use a &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52840_dongle/UG/nrf52840_Dongle/hw_swd_if.html"&gt;TC2050 cable from Tag-Connect&lt;/a&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We highly recommend adding debug capabilities if you are planning to develop applications for the dongle. If not, it is very hard for us to help you with any issues. The dongle is mainly intended for use with out development tools/precompiled applications.&lt;/p&gt;
&lt;p&gt;For more details, see the &lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;nRF52840 Dongle programming tutorial&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/361087?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 15:39:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddff84fa-851b-4d23-9ace-96900acbecb2</guid><dc:creator>Paul M.</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;J&amp;oslash;rgen,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I made all the modifications necessary to run the normal example on the Donlge. Like disabling UART, change the application to be build for pca10059, changed the GPIOs as well like so:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#elif defined(BOARD_PCA10059)&lt;br /&gt; m_camera_init.pinScl = 32;&lt;br /&gt; m_camera_init.pinSda = 24;&lt;br /&gt; m_camera_init.pinSck = 22;&lt;br /&gt; m_camera_init.pinMiso = 20;&lt;br /&gt; m_camera_init.pinMosi = 17;&lt;br /&gt; m_camera_init.pinCsn = 15;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The Image demo example does run without problems, only when I introduce the code which disables the camera via MOSFET does it crush. However, the same does not happen on the normal nrf52840. The GPIO I use for the gate of the MOSFET is pin 1.10 (I address it in the code with 32+10).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I do not have any debug capabilities, how could I using the Dongle? I use the bootloader solution with nRF programmer over the USB port.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for your help!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Paul&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning camera off in nrf52-ble-image-transfer-demo for nRF52840 Dongle</title><link>https://devzone.nordicsemi.com/thread/361046?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 13:08:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e77d815-82d7-4105-98e9-6f16664be0c5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Did you build the application for the pca10059, or did you run the pca10056 build on the dongle? Did you make any other modifications to the example to get it running on the Dongle? Do you use the same GPIOs (if not, which GPIOs do you use?), did you disable UART, etc?&lt;/p&gt;
&lt;p&gt;The reset behavior is typically due to an error/assert in the application, where the default behavior is to do a soft reset in the error handler.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have debug capabilities on your dongle? I.e., do you use a debugger to program the dongle, or do you use the bootloader solution that comes with the dongle to program it over the USB port?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>